Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Port most of the code to Python3 compatible. - #122

Merged
schaul merged 1 commit into
pybrain:masterfrom
wernight:master
Mar 24, 2014
Merged

schaul merged 1 commit into
pybrain:masterfrom
wernight:master

Conversation

@wernight

Copy link
Copy Markdown
Contributor

The code should still work on Python2.

Import and print are the main changes.

Not everything might be ported. The most part that was left intact are the range(). In Python2 it returns a list and in python it returns an iterator. This should speed up and in most cases should work without further changes.

See http://www.diveinto.org/python3/porting-code-to-python-3-with-2to3.html#xrange

@sansoncito

Copy link
Copy Markdown

Great job! I will test this soon hopefully.

@schaul

schaul commented Mar 24, 2014

Copy link
Copy Markdown
Collaborator

Looks good, thanks!

schaul added a commit that referenced this pull request Mar 24, 2014
Port most of the code to Python3 compatible.
@schaul
schaul merged commit d27709e into pybrain:master Mar 24, 2014
@schaul schaul mentioned this pull request Jun 24, 2014
@herodrigues

Copy link
Copy Markdown

@schaul , sorry for commenting in a issue that is already closed.
Anyway, I really want to contribute to this project and I think it's time to fully port it to Python3. However, I don't know what are the developers' priorities.

Should I try to port the entire code to Python3 or should I leave Python2 compatible?

@schaul

schaul commented Jun 24, 2014

Copy link
Copy Markdown
Collaborator

The ideal version would have the same code work with both Python 2 and 3, and it should be possible to do that, but in case of conflict, maintaining compatibility with Python 2 is the priority (at least for the near future).

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.

4 participants