2to3 <ul><li>porting summarized -  issues, workflows and solutions </li></ul>
intro /me <ul><li>Zubin Mithra </li></ul><ul><li>concurrency, version control, information security </li></ul><ul><li>been...
today we`ll be discussing <ul><li>how different is py3k? </li></ul><ul><li>d2, configobj </li></ul><ul><li>suitable workfl...
how different are they???
LOTS OF SMALL DIFFERENCES!!! <ul><li>http://docs.python.org/release/3.0.1/whatsnew/3.0.html </li></ul>
a _few_ of them ... <ul><li>dict.keys(), dict.values(), dict.items() return views -> not lists </li></ul><ul><ul><ul><li>u...
a _few_ of them ... <ul><li>print becomes print() </li></ul><ul><li>map(), filter(), zip() return iterators </li></ul><ul>...
one big change <ul><li>“Classic Division” </li></ul><ul><li>Real Division </li></ul><ul><li>Floor Division </li></ul><ul><...
and a few major ones ... <ul><li>All strings are UNICODE </li></ul><ul><li>(int, long) -> int </li></ul>
2to3 - the tool
using 2to3 <ul><li>$ 2to3 -w blah.py </li></ul>
porting experiences so far
porting d2 <ul><li>more than 60 files -> 7200 lines approx. </li></ul><ul><li>d2 has the same codebase for 2.x and 3.x </l...
porting configobj <ul><li>converted the repo over to mercurial </li></ul><ul><li>ran tests (which failed) </li></ul><ul><l...
single vs. multiple codebases <ul><li>Single codebase </li></ul><ul><ul><li>apply bug-fixes once </li></ul></ul><ul><ul><l...
single vs. multiple codebases <ul><li>Multiple codebase </li></ul><ul><ul><li>neater codebase </li></ul></ul><ul><ul><li>a...
single vs. multiple codebases <ul><li>expecting rapid development soon? </li></ul><ul><ul><li>use a single branch for now,...
helping the community <ul><li>stdlib/3rd party library </li></ul><ul><li>web-frameworks </li></ul><ul><li>python-porting M...
Unicode and Py3k
long => integer
AACK! warning! <ul><li>DO NOT use python3.0 </li></ul><ul><ul><ul><ul><li>use python3.1 </li></ul></ul></ul></ul><ul><ul><...
doubts, anyone?
well, c u around then!
Upcoming SlideShare
Loading in …5
×

2to3

290 views
241 views

Published on

Talk slides for Pycon-India 2010.
Topi

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
290
On SlideShare
0
From Embeds
0
Number of Embeds
6
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

2to3

  1. 1. 2to3 <ul><li>porting summarized - issues, workflows and solutions </li></ul>
  2. 2. intro /me <ul><li>Zubin Mithra </li></ul><ul><li>concurrency, version control, information security </li></ul><ul><li>been working on python for a little more over a year </li></ul>
  3. 3. today we`ll be discussing <ul><li>how different is py3k? </li></ul><ul><li>d2, configobj </li></ul><ul><li>suitable workflow </li></ul><ul><li>how to contribute </li></ul><ul><li>few changes in detail </li></ul>
  4. 4. how different are they???
  5. 5. LOTS OF SMALL DIFFERENCES!!! <ul><li>http://docs.python.org/release/3.0.1/whatsnew/3.0.html </li></ul>
  6. 6. a _few_ of them ... <ul><li>dict.keys(), dict.values(), dict.items() return views -> not lists </li></ul><ul><ul><ul><li>use sorted(d) </li></ul></ul></ul>
  7. 7. a _few_ of them ... <ul><li>print becomes print() </li></ul><ul><li>map(), filter(), zip() return iterators </li></ul><ul><li>range() behaves like xrange() </li></ul>
  8. 8. one big change <ul><li>“Classic Division” </li></ul><ul><li>Real Division </li></ul><ul><li>Floor Division </li></ul><ul><li>“New Division” </li></ul>
  9. 9. and a few major ones ... <ul><li>All strings are UNICODE </li></ul><ul><li>(int, long) -> int </li></ul>
  10. 10. 2to3 - the tool
  11. 11. using 2to3 <ul><li>$ 2to3 -w blah.py </li></ul>
  12. 12. porting experiences so far
  13. 13. porting d2 <ul><li>more than 60 files -> 7200 lines approx. </li></ul><ul><li>d2 has the same codebase for 2.x and 3.x </li></ul><ul><li>run 2to3 </li></ul><ul><li>make sure the tests work. fix stuff if they don`t </li></ul>
  14. 14. porting configobj <ul><li>converted the repo over to mercurial </li></ul><ul><li>ran tests (which failed) </li></ul><ul><li>make the tests work </li></ul><ul><ul><ul><li>work not complete! help is appreciated! </li></ul></ul></ul><ul><ul><ul><li>http://bitbucket.org/zubin71/configobj </li></ul></ul></ul>
  15. 15. single vs. multiple codebases <ul><li>Single codebase </li></ul><ul><ul><li>apply bug-fixes once </li></ul></ul><ul><ul><li>codebase becomes messier as you try to increase compatibility with different version </li></ul></ul>
  16. 16. single vs. multiple codebases <ul><li>Multiple codebase </li></ul><ul><ul><li>neater codebase </li></ul></ul><ul><ul><li>apply your bug-fixes on two branches </li></ul></ul><ul><ul><li>you probably have to do this if you intend to re-design your APIs </li></ul></ul>
  17. 17. single vs. multiple codebases <ul><li>expecting rapid development soon? </li></ul><ul><ul><li>use a single branch for now, use another branch when you feel you have enough time to apply patches to 2 branches </li></ul></ul>
  18. 18. helping the community <ul><li>stdlib/3rd party library </li></ul><ul><li>web-frameworks </li></ul><ul><li>python-porting ML </li></ul><ul><li>PSF sponsored sprints </li></ul>
  19. 19. Unicode and Py3k
  20. 20. long => integer
  21. 21. AACK! warning! <ul><li>DO NOT use python3.0 </li></ul><ul><ul><ul><ul><li>use python3.1 </li></ul></ul></ul></ul><ul><ul><ul><ul><li>python3.2 alpha is out. Final release scheduled for Jan 15, 2011 </li></ul></ul></ul></ul>
  22. 22. doubts, anyone?
  23. 23. well, c u around then!

×