Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upUpdating the source to Python 3? #208
Comments
|
+1 Python 2/3 compliant code |
|
I second @pylang. Python 2/3 compatibility is more important than type annotations for this project |
|
While we're on the topic of python 3, I am finding a difference in behaviour running the registry example. With python 3.6 I do not see the |
|
In python 3 metaclass is added differently class BaseRegisteredClass(object, metaclass=RegistryHolder):instead of class BaseRegisteredClass(object):
__metaclass__ = RegistryHolderhttps://stackoverflow.com/questions/5189232/how-to-auto-register-a-class-when-its-defined |
|
More than a year since last comment here. Maybe it's time to remember about the topic? :) Considering python2's EOL I would like to see python3-only code. |
|
There are 11 months left until Python2 EOL -1 for type annotations. |
|
Agree with @fkromer Let's revisit this after the Python 2 EOL |
|
There are a couple of examples with
Proposition:
This is different from "Update everything to Python3 syntax, use f-strings, etc etc ". |
|
@gyermolenko How about using six until the Python 2 EOL? After that, we can get rid of it and keep only the Python 3 functionality |
|
My issue with Examples below: class Meta(type):
pass
# Python 2 only:
class MyClass(Meta):
__metaclass__ = Meta
pass
# Python 3 only:
class MyClass(metaclass=Meta):
pass
# with six
from six import with_metaclass
class MyClass(with_metaclass(Meta)):
passps. I am pro Python3-first, not Python3-only approach. |
|
The maybe it's better to split those files to Python 2/3 versions until the Python 2 EOL |
|
hey @faif So maybe it makes sense to create git tag or release and proceed with py3-only version in master?
And with git tag later someone can switch from github ui or do git checkout past versions easily. Please share your thoughts so I prepare changes accordingly. |
|
I like the tag solution. That way anyone still interested in the Python 2 solutions can access them. Let’s cleanup master to use Python 3 only and have a reference to the tag. |
|
I think only you can push new tags. |
|
@gyermolenko I pushed a legacy tag that contains the current repo contents. Feel free to start cleaning up |
|
the issue can be closed |


Just a quick comment--looking over the source, do you think it'd be a good idea to update to Python 3, e.g. using type annotations and Python 3 syntax?