Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python3 #321

Closed
wants to merge 30 commits into from
Closed

Python3 #321

wants to merge 30 commits into from

Conversation

riyadparvez
Copy link

Ported to Python 3.
converted print "" print("")

@mehcode
Copy link

mehcode commented Oct 6, 2013

Nice effort; however, the project probably won't accept this unless it keeps at least 2.7 compatiblity (which isn't too hard, all things considered).

@Ivoz
Copy link
Contributor

Ivoz commented Oct 7, 2013

Denis has mentioned 2.6-3-3, previously

@nhoad
Copy link
Contributor

nhoad commented Oct 7, 2013

  • Set comprehensions aren't available until 2.7.
  • metaclasses definitions are __metaclass__ in all Python 2 releases.
  • Changing all xrange calls to range is a bad idea for 2.x compatibility, as is changing dict.iteritems() calls to dict.items()
  • Adding parentheses breaks things in some cases, e.g. exec("import %s" % modname in {}) tries to exec False.

@mehcode
Copy link

mehcode commented Oct 7, 2013

Just to throw this out there. Perhaps http://pythonhosted.org/six/ ?

@ghost
Copy link

ghost commented Oct 8, 2013

$ PYTHONPATH=.. python testrunner.py --expected ../known_failures.txt File "testrunner.py", line 92 tests = {glob.glob('test_*.py')) - set(['test_support.py']} ^ SyntaxError: invalid syntax

@wienczny
Copy link

What is the current state on this pull request?

@Elizafox
Copy link

Aren't you repeating the efforts of #38 ?

@Ivoz
Copy link
Contributor

Ivoz commented Oct 22, 2013

@wienczny It's horribly broken for python 2.

@wienczny
Copy link

@Ivoz So what is the plan to resolve these issues? What has to be the baseline python version after adding py3k support? 2.6? 2.7? As already asked: would a dependency to six be accepted? Another alternative would be 2to3 and 3to2.

@sabernar
Copy link

Master should be branched to a <3.0 branch and the master should be used for >3.0. At some point the python community needs to start living in the present and stop living in the past. gevent works fine for 2.6 & 2.7 and not at all for 3.3. In my opinion, this is deplorable. There should be at the VERY least, a branch for 3.3 that is maintained in parallel, if the owners of gevent, for whatever reason, refuse to maintain them together.

@riyadparvez
Copy link
Author

I totally agree with the a python 3 branch.

@layzerar
Copy link

How about six module: https://pypi.python.org/pypi/six. Openstack has used it for several months.

@Ivoz
Copy link
Contributor

Ivoz commented Oct 31, 2013

The hardest code to convert with gevent is the underlying plumbing. Gevent's cython, and socket interfaces.

These are not simply things you can convert with 2to3 or six or whatever else at the drop of a hat, and is precisely why gevent is one of the last python libraries to remain on 2.

@sabernar
Copy link

So, if it’s that hard, it probably should have been started a while ago. I don’t think that the difficulty level is a reason to not (or to delay) doing it. A large portion of the python community depends on gevent, so there should be a concerted effort to help move the community forward.

On Oct 30, 2013, at 6:25 PM, Matt Iversen notifications@github.com wrote:

The hardest code to convert with gevent is the underlying plumbing. Greenlet and gevent's cython, and socket interfaces.

These are not simply things you can convert with 2to3 or six or whatever else at the drop of a hat, and is precisely why gevent is one of the last python libraries to remain on 2.


Reply to this email directly or view it on GitHub.

@layzerar
Copy link

layzerar commented Nov 1, 2013

Well, as the document of Cython, Cython has already supported Python 3.x . And Gevent didn't depend on the Python APIs. The only thing is the socket interfaces. Why does it still hard?

@layzerar
Copy link

layzerar commented Nov 1, 2013

Oh, I was wrong, the Python API dependency is a problem.

@uschen
Copy link

uschen commented Nov 14, 2013

seem riyadparvez's pr will have this error?
gevent/socket.py", line 117, in
_fileobject = socket._fileobject
AttributeError: 'module' object has no attribute '_fileobject'

@denik denik closed this Dec 1, 2013
@denik
Copy link
Member

denik commented Dec 1, 2013

Have to close this: master now has some parts of this PR but in a manner that is compatible with 2.6+. New PRs should be 2.6+ compatible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants