Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Austin Python Meetup 2017: How to Stop Worrying and Start a Project with Python 3

871 views

Published on

The talk "How to stop worrying and start a project with Python 3 " based on my production experience of using the technology. Typical fears of the engineers which use Python 2 are addressed.

Published in: Software
  • Be the first to comment

Austin Python Meetup 2017: How to Stop Worrying and Start a Project with Python 3

  1. 1. How to Stop Worrying and Start a Project with Python 3 Viacheslav Kakovskyi Austin Python Meetup 2017
  2. 2. Me! Backend Software Technical Lead Python 2 and Twisted → Python 3 and asyncio Ukraine → Austin, Texas Share knowledge at Python events ● PyCon Ukraine 2016 ● PyCon Poland 2016 ● KyivPy 2015, WebCamp Ukraine 2016 ● Austin Python Meetup 2017 2 @kakovskyi
  3. 3. 3 3 months back from today... https://www.slideshare.net/mariczhuck/austin-python-meetup-2017-whats-new-in-pythons-35-and-36
  4. 4. Agenda 1. The story about my journey from 2 to 3 2. Should I use Python 3, not 2? 3. Discover the benefits with your team 4. How to discuss switching to Python 3 with your manager 5. Summary 4
  5. 5. Who uses Python 3 in production? 5
  6. 6. The story about my journey 6 # python2 @defer.inlineCallbacks # python2, small projects @app.route('')
  7. 7. The story about my journey 7 # python2, big project d = defer.Deferred() d.addCallback(foo) d.addErrback(bar) # python3, non-commercial project async / await
  8. 8. The story about my journey 8 # python3, big project
  9. 9. Should I use Python 3, not 2? 9
  10. 10. Reasons to use Python 3 for a developer 10
  11. 11. Reasons to use Python 3 for a developer 11 New syntax features make our life easier ● PEP 448, additional unpacking generalizations ● PEP 465, a new matrix multiplication operator `a @ b` ● PEP 492, coroutines with async and await syntax ● PEP 498, formatted string literals ● PEP 515, underscores in numeric literals ● PEP 525, asynchronous generators ● PEP 526, syntax for variable annotations ● PEP 530, asynchronous comprehensions ● and others
  12. 12. PyCharm: in late 2017 py3.users > py2.users 12
  13. 13. Does ... work with Python 3? 13 95% of most popular PyPI libraries support Python 3 http://py3readiness.org/
  14. 14. New Python libraries will be Python 3 only 14 Libs tagged on PyPI ● Python 3: 55.5% ○ 75669 releases ● Python 2: 44.5% ○ 60732 releases
  15. 15. Libs releases tagged on PyPI 15 Python 3 (75669) ● 3 (22701) ● 3.0 (733) ● 3.1 (1161) ● 3.2 (4902) ● 3.3 (13462) ● 3.4 (17117) ● 3.5 (12793) ● 3.6 (2800) Python 2 (60732) ● 2 (16725) ● 2.3 (87) ● 2.4 (440) ● 2.5 (1333) ● 2.6 (11142) ● 2.7 (31005)
  16. 16. Py2 EOL in 3 yrs 16 https://pythonclock.org/
  17. 17. 17 Is Python 3 a thing for your team?
  18. 18. Rewriting Python 2 service from scratch with Python 3 18
  19. 19. 19 (STARE) ARE YOU SURE?
  20. 20. Extending functionality with new services 20
  21. 21. Creating async services easily 21
  22. 22. Welcome to the async World! 22 ○ aiohttp_admin ○ aiomcache ○ aiocouchdb ○ aiomeasures ○ aiobotocore ○ aiozmq ○ aioodbc ○ aiokafka ○ aioes ○ your async library here ○ aiohttp ○ aiopg ○ aiomysql ○ aioredis ○ aiokafka
  23. 23. Better developers experience 23 ● async /await ● typing module and type hinting ● tracemalloc module ● asynctest library ● hypothesis library ● behave library
  24. 24. Discuss switching to Python 3 with your manager 24
  25. 25. 0. Make side project with Python 3 25
  26. 26. 1. Find small isolated part of your project 26
  27. 27. 2. Implement that with Python 3 using the new things 27
  28. 28. 28 3. Tell the manager that the part will still be working in 2020... not as the rest of codebase
  29. 29. (previous slide was a joke) 29
  30. 30. Experience of my team: Dev speed is pretty good after the first month 30
  31. 31. Summary ● The future is already here ● Learn new Python 3 features - they are great ● Make side projects and prototypes to gain experience ● New learners - invest your time only in Python 3 ● Start new projects only with Python 3 31
  32. 32. 32
  33. 33. 33 @kakovskyi viach.kakovskyi@gmail.com Questions?

×