SlideShare uma empresa Scribd logo
1 de 21
Baixar para ler offline
What's New in Pythons 3.5 and 3.6?
Viacheslav Kakovskyi
Austin Python Meetup 2017
my favourite features
Me!
@kakovskyi
Backend Software Technical Lead
Python 2 and Twisted → Python 3 and asyncio
Share knowledge at Python events
● PyCon Ukraine 2016
● PyCon Poland 2016
● KyivPy 2015, WebCamp Ukraine 2016
2
Agenda
1. Syntax changes
2. Library modules
3. Built-in features
4. CPython improvements
5. Standard library improvements
6. Summary
7. Further reading
3
Who uses Python 3 in production?
4
Who uses Python 3 in production?
5
Syntax changes
PEP 492 - coroutines with async and await syntax
● async expression used to define coroutine functions
● await is used to suspend coroutine execution until result is
available
● implement object.__await__(self) to make your object
awaitable
6
Python 3.5
async def http_handler():
users = await get_users_from_db()
return '<h1>Online users {}</h1>'.format(len(users))
Syntax changes
PEP 448 - additional unpacking generalizations
● * expression used as iterable unpacking operator
● and ** as dictionary unpacking operator
7
Python 3.5
>>> print(*[1], *{2}, 3)
1 2 3
>>> print({'x': 4, **{'y': 5}})
{'x': 4, 'y': 5}
Syntax changes
PEP 515 - underscores in numeric literals
8
Python 3.6
>>> 100_500_000
100500000
>>> 0x_DE_AD_BE_AF
3735928495
>>> '{:_}'1.format(100500000)
100_500_000
>>> '{:_x}'1.format(3735928495)
0x_DE_AD_BE_AF
Syntax changes
PEP 530 - asynchronous comprehensions
● Now it's possible to use async for in list, set, dict
comprehensions and generator expressions
● await and can be used inside the expressions
9
Python 3.6
result = [await fun() for fun in funcs if await condition()]
Library modules
typing - support of type hints for static code analysis only for
functions
PEP 526 - add support of type annotation for variables (Py3.6)
● Any, Awaitable Callable, Collection, Coroutine,
● Dict, FrozenSet, Generator, Iterable, Iterator
● List, NewType, Set, Tuple
10
Python 3.5
def greeting(name: str) -> str:
return 'Hello, {}'.format(name)
Built-in features
PEP-461 - percent formatting support for bytes and bytearray
11
Python 3.5
>>> b'Hello, %b' % b'Austin!'
b'Hello, Austin!'
Built-in features
RecursionError is raised when max recursion depth is reached
12
Python 3.5
def recursion(level):
# do something awesome
return recursion(level+1)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 2, in a
File "<stdin>", line 2, in a
File "<stdin>", line 2, in a
[Previous line repeated 995 more times]
RecursionError: maximum recursion depth exceeded
CPython improvements
PEP-488 Elimination of PYO files
● .pyo files are never used
● .pyc files are used with explicit declaration of optimization
level in filename
13
Python 3.5
'{name}.{cache_tag}.opt-{optimization}.pyc'.format(name=module_name,
cache_tag=sys.implementation.cache_tag,
optimization=str(sys.flags.optimize))
CPython improvements
Compact and ordered dict improvement
● Memory usage is 20% less compared to Python 3.5
● dict preserves order of insertion now
14
Python 3.6
>>> d = {}
>>> d['a'] = 1
>>> d['b'] = 2
>>> d['c'] = 3
>>> d
{'a': 1, 'b': 2, 'c': 3}
PEP-487 Simpler customization of class creation
● no metaclasses, I promise you
● __init_subclass__ method will be called on base class when
a subclass is created
CPython improvements
15
Python 3.6
● colection.OrderedDict is implemented in C and just faster
● os.scandir() provides faster way for directory traversal
● functools.lru_cache() has been reimplemented in C
● traceback is more handy for devs and faster too
Standard library improvements
16
Python 3.5
● asyncio received new features and considered as stable
● typing has been improved and isn't in provisional state
● tracemalloc provides better output for memory allocation
errors
● pathlib has been improved and system path protocol is
implemented
Standard library improvements
17
Python 3.6
Summary
● Use Python 3, asyncio and aiohttp for networking
applications
18
Further reading
● @kakovskyi
○ Maintaining a high load Python project for newcomers
○ Maintaining a high load Python project: typical mistakes
○ Instant messenger with Python. Back-end development
○ How to easily find the optimal solution without exhaustive search
using Genetic Algorithms
● @bmwant
○ Asyncio-stack for web development
○ PEP8 is not enough
○ PyInvoke is your replacement for Makefile
19
20
@kakovskyi
viach.kakovskyi@gmail.com
Questions?
Senior Platform Developers needed
tiny.cc/atlassian_atx
21

Mais conteúdo relacionado

Mais procurados

Types - slice, map, new, make, struct - Gopherlabs
Types - slice, map, new, make, struct - Gopherlabs Types - slice, map, new, make, struct - Gopherlabs
Types - slice, map, new, make, struct - Gopherlabs sangam biradar
 
Luigi Presentation at OSCON 2013
Luigi Presentation at OSCON 2013Luigi Presentation at OSCON 2013
Luigi Presentation at OSCON 2013Erik Bernhardsson
 
Translating Qt Applications
Translating Qt ApplicationsTranslating Qt Applications
Translating Qt Applicationsaccount inactive
 
Managing large scale projects in R with R Suite
Managing large scale projects in R with R SuiteManaging large scale projects in R with R Suite
Managing large scale projects in R with R SuiteWLOG Solutions
 
Luigi presentation NYC Data Science
Luigi presentation NYC Data ScienceLuigi presentation NYC Data Science
Luigi presentation NYC Data ScienceErik Bernhardsson
 
How to lock a Python in a cage? Managing Python environment inside an R project
How to lock a Python in a cage?  Managing Python environment inside an R projectHow to lock a Python in a cage?  Managing Python environment inside an R project
How to lock a Python in a cage? Managing Python environment inside an R projectWLOG Solutions
 
202107 - Orion introduction - COSCUP
202107 - Orion introduction - COSCUP202107 - Orion introduction - COSCUP
202107 - Orion introduction - COSCUPRonald Hsu
 
Declarative Infrastructure Tools
Declarative Infrastructure Tools Declarative Infrastructure Tools
Declarative Infrastructure Tools Yulia Shcherbachova
 
Network programming with Qt (C++)
Network programming with Qt (C++)Network programming with Qt (C++)
Network programming with Qt (C++)Manohar Kuse
 
Calling python from r
Calling python from rCalling python from r
Calling python from rBarry DeCicco
 
Managing data workflows with Luigi
Managing data workflows with LuigiManaging data workflows with Luigi
Managing data workflows with LuigiTeemu Kurppa
 
Ganga: an interface to the LHC computing grid
Ganga: an interface to the LHC computing gridGanga: an interface to the LHC computing grid
Ganga: an interface to the LHC computing gridMatt Williams
 
Python VS GO
Python VS GOPython VS GO
Python VS GOOfir Nir
 
Infinum android talks_10_getting groovy on android
Infinum android talks_10_getting groovy on androidInfinum android talks_10_getting groovy on android
Infinum android talks_10_getting groovy on androidInfinum
 
Data correlation using PySpark and HDFS
Data correlation using PySpark and HDFSData correlation using PySpark and HDFS
Data correlation using PySpark and HDFSJohn Conley
 
Asynchronous single page applications without a line of HTML or Javascript, o...
Asynchronous single page applications without a line of HTML or Javascript, o...Asynchronous single page applications without a line of HTML or Javascript, o...
Asynchronous single page applications without a line of HTML or Javascript, o...Robert Schadek
 
Vasia Kalavri – Training: Gelly School
Vasia Kalavri – Training: Gelly School Vasia Kalavri – Training: Gelly School
Vasia Kalavri – Training: Gelly School Flink Forward
 
Programming language for the cloud infrastructure
Programming language for the cloud infrastructureProgramming language for the cloud infrastructure
Programming language for the cloud infrastructureYaroslav Muravskyi
 
Data science workflows: from notebooks to production
Data science workflows: from notebooks to productionData science workflows: from notebooks to production
Data science workflows: from notebooks to productionMarissa Saunders
 

Mais procurados (20)

Types - slice, map, new, make, struct - Gopherlabs
Types - slice, map, new, make, struct - Gopherlabs Types - slice, map, new, make, struct - Gopherlabs
Types - slice, map, new, make, struct - Gopherlabs
 
C++ Coroutines
C++ CoroutinesC++ Coroutines
C++ Coroutines
 
Luigi Presentation at OSCON 2013
Luigi Presentation at OSCON 2013Luigi Presentation at OSCON 2013
Luigi Presentation at OSCON 2013
 
Translating Qt Applications
Translating Qt ApplicationsTranslating Qt Applications
Translating Qt Applications
 
Managing large scale projects in R with R Suite
Managing large scale projects in R with R SuiteManaging large scale projects in R with R Suite
Managing large scale projects in R with R Suite
 
Luigi presentation NYC Data Science
Luigi presentation NYC Data ScienceLuigi presentation NYC Data Science
Luigi presentation NYC Data Science
 
How to lock a Python in a cage? Managing Python environment inside an R project
How to lock a Python in a cage?  Managing Python environment inside an R projectHow to lock a Python in a cage?  Managing Python environment inside an R project
How to lock a Python in a cage? Managing Python environment inside an R project
 
202107 - Orion introduction - COSCUP
202107 - Orion introduction - COSCUP202107 - Orion introduction - COSCUP
202107 - Orion introduction - COSCUP
 
Declarative Infrastructure Tools
Declarative Infrastructure Tools Declarative Infrastructure Tools
Declarative Infrastructure Tools
 
Network programming with Qt (C++)
Network programming with Qt (C++)Network programming with Qt (C++)
Network programming with Qt (C++)
 
Calling python from r
Calling python from rCalling python from r
Calling python from r
 
Managing data workflows with Luigi
Managing data workflows with LuigiManaging data workflows with Luigi
Managing data workflows with Luigi
 
Ganga: an interface to the LHC computing grid
Ganga: an interface to the LHC computing gridGanga: an interface to the LHC computing grid
Ganga: an interface to the LHC computing grid
 
Python VS GO
Python VS GOPython VS GO
Python VS GO
 
Infinum android talks_10_getting groovy on android
Infinum android talks_10_getting groovy on androidInfinum android talks_10_getting groovy on android
Infinum android talks_10_getting groovy on android
 
Data correlation using PySpark and HDFS
Data correlation using PySpark and HDFSData correlation using PySpark and HDFS
Data correlation using PySpark and HDFS
 
Asynchronous single page applications without a line of HTML or Javascript, o...
Asynchronous single page applications without a line of HTML or Javascript, o...Asynchronous single page applications without a line of HTML or Javascript, o...
Asynchronous single page applications without a line of HTML or Javascript, o...
 
Vasia Kalavri – Training: Gelly School
Vasia Kalavri – Training: Gelly School Vasia Kalavri – Training: Gelly School
Vasia Kalavri – Training: Gelly School
 
Programming language for the cloud infrastructure
Programming language for the cloud infrastructureProgramming language for the cloud infrastructure
Programming language for the cloud infrastructure
 
Data science workflows: from notebooks to production
Data science workflows: from notebooks to productionData science workflows: from notebooks to production
Data science workflows: from notebooks to production
 

Destaque

WebCamp Ukraine 2016: Instant messenger with Python. Back-end development
WebCamp Ukraine 2016: Instant messenger with Python. Back-end developmentWebCamp Ukraine 2016: Instant messenger with Python. Back-end development
WebCamp Ukraine 2016: Instant messenger with Python. Back-end developmentViach Kakovskyi
 
Luigi presentation OA Summit
Luigi presentation OA SummitLuigi presentation OA Summit
Luigi presentation OA SummitOpen Analytics
 
Python as part of a production machine learning stack by Michael Manapat PyDa...
Python as part of a production machine learning stack by Michael Manapat PyDa...Python as part of a production machine learning stack by Michael Manapat PyDa...
Python as part of a production machine learning stack by Michael Manapat PyDa...PyData
 
Python3 cheatsheet
Python3 cheatsheetPython3 cheatsheet
Python3 cheatsheetGil Cohen
 
Using Deep Learning to do Real-Time Scoring in Practical Applications
Using Deep Learning to do Real-Time Scoring in Practical ApplicationsUsing Deep Learning to do Real-Time Scoring in Practical Applications
Using Deep Learning to do Real-Time Scoring in Practical ApplicationsGreg Makowski
 
word2vec - From theory to practice
word2vec - From theory to practiceword2vec - From theory to practice
word2vec - From theory to practicehen_drik
 
Python Data Wrangling: Preparing for the Future
Python Data Wrangling: Preparing for the FuturePython Data Wrangling: Preparing for the Future
Python Data Wrangling: Preparing for the FutureWes McKinney
 
Building High Performing Teams
Building High Performing TeamsBuilding High Performing Teams
Building High Performing TeamsMarion Stone
 
A Beginner's Guide to Building Data Pipelines with Luigi
A Beginner's Guide to Building Data Pipelines with LuigiA Beginner's Guide to Building Data Pipelines with Luigi
A Beginner's Guide to Building Data Pipelines with LuigiGrowth Intelligence
 
High Performance Python on Apache Spark
High Performance Python on Apache SparkHigh Performance Python on Apache Spark
High Performance Python on Apache SparkWes McKinney
 

Destaque (10)

WebCamp Ukraine 2016: Instant messenger with Python. Back-end development
WebCamp Ukraine 2016: Instant messenger with Python. Back-end developmentWebCamp Ukraine 2016: Instant messenger with Python. Back-end development
WebCamp Ukraine 2016: Instant messenger with Python. Back-end development
 
Luigi presentation OA Summit
Luigi presentation OA SummitLuigi presentation OA Summit
Luigi presentation OA Summit
 
Python as part of a production machine learning stack by Michael Manapat PyDa...
Python as part of a production machine learning stack by Michael Manapat PyDa...Python as part of a production machine learning stack by Michael Manapat PyDa...
Python as part of a production machine learning stack by Michael Manapat PyDa...
 
Python3 cheatsheet
Python3 cheatsheetPython3 cheatsheet
Python3 cheatsheet
 
Using Deep Learning to do Real-Time Scoring in Practical Applications
Using Deep Learning to do Real-Time Scoring in Practical ApplicationsUsing Deep Learning to do Real-Time Scoring in Practical Applications
Using Deep Learning to do Real-Time Scoring in Practical Applications
 
word2vec - From theory to practice
word2vec - From theory to practiceword2vec - From theory to practice
word2vec - From theory to practice
 
Python Data Wrangling: Preparing for the Future
Python Data Wrangling: Preparing for the FuturePython Data Wrangling: Preparing for the Future
Python Data Wrangling: Preparing for the Future
 
Building High Performing Teams
Building High Performing TeamsBuilding High Performing Teams
Building High Performing Teams
 
A Beginner's Guide to Building Data Pipelines with Luigi
A Beginner's Guide to Building Data Pipelines with LuigiA Beginner's Guide to Building Data Pipelines with Luigi
A Beginner's Guide to Building Data Pipelines with Luigi
 
High Performance Python on Apache Spark
High Performance Python on Apache SparkHigh Performance Python on Apache Spark
High Performance Python on Apache Spark
 

Semelhante a Austin Python Meetup 2017: What's New in Pythons 3.5 and 3.6?

Commit ускоривший python 2.7.11 на 30% и новое в python 3.5
Commit ускоривший python 2.7.11 на 30% и новое в python 3.5Commit ускоривший python 2.7.11 на 30% и новое в python 3.5
Commit ускоривший python 2.7.11 на 30% и новое в python 3.5PyNSK
 
PyCon 2013 : Scripting to PyPi to GitHub and More
PyCon 2013 : Scripting to PyPi to GitHub and MorePyCon 2013 : Scripting to PyPi to GitHub and More
PyCon 2013 : Scripting to PyPi to GitHub and MoreMatt Harrison
 
Python Evolution
Python EvolutionPython Evolution
Python EvolutionQuintagroup
 
Tips and tricks for data science projects with Python
Tips and tricks for data science projects with Python Tips and tricks for data science projects with Python
Tips and tricks for data science projects with Python Jose Manuel Ortega Candel
 
جلسه اول پایتون برای هکر های قانونی دوره مقدماتی پاییز ۹۲
جلسه اول پایتون برای هکر های قانونی دوره مقدماتی پاییز ۹۲جلسه اول پایتون برای هکر های قانونی دوره مقدماتی پاییز ۹۲
جلسه اول پایتون برای هکر های قانونی دوره مقدماتی پاییز ۹۲Mohammad Reza Kamalifard
 
PyCon Taiwan 2013 Tutorial
PyCon Taiwan 2013 TutorialPyCon Taiwan 2013 Tutorial
PyCon Taiwan 2013 TutorialJustin Lin
 
Faster Python Programs Through Optimization by Dr.-Ing Mike Muller
Faster Python Programs Through Optimization by Dr.-Ing Mike MullerFaster Python Programs Through Optimization by Dr.-Ing Mike Muller
Faster Python Programs Through Optimization by Dr.-Ing Mike MullerPyData
 
New in Plone 3.3. What to expect from Plone 4
New in Plone 3.3. What to expect from Plone 4New in Plone 3.3. What to expect from Plone 4
New in Plone 3.3. What to expect from Plone 4Quintagroup
 
20120314 changa-python-workshop
20120314 changa-python-workshop20120314 changa-python-workshop
20120314 changa-python-workshopamptiny
 
Python and Pytorch tutorial and walkthrough
Python and Pytorch tutorial and walkthroughPython and Pytorch tutorial and walkthrough
Python and Pytorch tutorial and walkthroughgabriellekuruvilla
 
Software development practices in python
Software development practices in pythonSoftware development practices in python
Software development practices in pythonJimmy Lai
 
Advanced Python Tutorial | Learn Advanced Python Concepts | Python Programmin...
Advanced Python Tutorial | Learn Advanced Python Concepts | Python Programmin...Advanced Python Tutorial | Learn Advanced Python Concepts | Python Programmin...
Advanced Python Tutorial | Learn Advanced Python Concepts | Python Programmin...Edureka!
 
Programming with Python - Basic
Programming with Python - BasicProgramming with Python - Basic
Programming with Python - BasicMosky Liu
 
Euro python2011 High Performance Python
Euro python2011 High Performance PythonEuro python2011 High Performance Python
Euro python2011 High Performance PythonIan Ozsvald
 
Pypy is-it-ready-for-production-the-sequel
Pypy is-it-ready-for-production-the-sequelPypy is-it-ready-for-production-the-sequel
Pypy is-it-ready-for-production-the-sequelMark Rees
 
Pynvme introduction
Pynvme introductionPynvme introduction
Pynvme introductionCrane Chu
 

Semelhante a Austin Python Meetup 2017: What's New in Pythons 3.5 and 3.6? (20)

Commit ускоривший python 2.7.11 на 30% и новое в python 3.5
Commit ускоривший python 2.7.11 на 30% и новое в python 3.5Commit ускоривший python 2.7.11 на 30% и новое в python 3.5
Commit ускоривший python 2.7.11 на 30% и новое в python 3.5
 
PyCon 2013 : Scripting to PyPi to GitHub and More
PyCon 2013 : Scripting to PyPi to GitHub and MorePyCon 2013 : Scripting to PyPi to GitHub and More
PyCon 2013 : Scripting to PyPi to GitHub and More
 
Python Evolution
Python EvolutionPython Evolution
Python Evolution
 
Tips and tricks for data science projects with Python
Tips and tricks for data science projects with Python Tips and tricks for data science projects with Python
Tips and tricks for data science projects with Python
 
جلسه اول پایتون برای هکر های قانونی دوره مقدماتی پاییز ۹۲
جلسه اول پایتون برای هکر های قانونی دوره مقدماتی پاییز ۹۲جلسه اول پایتون برای هکر های قانونی دوره مقدماتی پاییز ۹۲
جلسه اول پایتون برای هکر های قانونی دوره مقدماتی پاییز ۹۲
 
PHYTON-REPORT.pdf
PHYTON-REPORT.pdfPHYTON-REPORT.pdf
PHYTON-REPORT.pdf
 
PyCon Estonia 2019
PyCon Estonia 2019PyCon Estonia 2019
PyCon Estonia 2019
 
PyCon Taiwan 2013 Tutorial
PyCon Taiwan 2013 TutorialPyCon Taiwan 2013 Tutorial
PyCon Taiwan 2013 Tutorial
 
Faster Python Programs Through Optimization by Dr.-Ing Mike Muller
Faster Python Programs Through Optimization by Dr.-Ing Mike MullerFaster Python Programs Through Optimization by Dr.-Ing Mike Muller
Faster Python Programs Through Optimization by Dr.-Ing Mike Muller
 
New in Plone 3.3. What to expect from Plone 4
New in Plone 3.3. What to expect from Plone 4New in Plone 3.3. What to expect from Plone 4
New in Plone 3.3. What to expect from Plone 4
 
20120314 changa-python-workshop
20120314 changa-python-workshop20120314 changa-python-workshop
20120314 changa-python-workshop
 
Python and Pytorch tutorial and walkthrough
Python and Pytorch tutorial and walkthroughPython and Pytorch tutorial and walkthrough
Python and Pytorch tutorial and walkthrough
 
Python Orientation
Python OrientationPython Orientation
Python Orientation
 
Software development practices in python
Software development practices in pythonSoftware development practices in python
Software development practices in python
 
Advanced Python Tutorial | Learn Advanced Python Concepts | Python Programmin...
Advanced Python Tutorial | Learn Advanced Python Concepts | Python Programmin...Advanced Python Tutorial | Learn Advanced Python Concepts | Python Programmin...
Advanced Python Tutorial | Learn Advanced Python Concepts | Python Programmin...
 
05 python.pdf
05 python.pdf05 python.pdf
05 python.pdf
 
Programming with Python - Basic
Programming with Python - BasicProgramming with Python - Basic
Programming with Python - Basic
 
Euro python2011 High Performance Python
Euro python2011 High Performance PythonEuro python2011 High Performance Python
Euro python2011 High Performance Python
 
Pypy is-it-ready-for-production-the-sequel
Pypy is-it-ready-for-production-the-sequelPypy is-it-ready-for-production-the-sequel
Pypy is-it-ready-for-production-the-sequel
 
Pynvme introduction
Pynvme introductionPynvme introduction
Pynvme introduction
 

Último

How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfCionsystems
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendArshad QA
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 

Último (20)

Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Active Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdfActive Directory Penetration Testing, cionsystems.com.pdf
Active Directory Penetration Testing, cionsystems.com.pdf
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and Backend
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 

Austin Python Meetup 2017: What's New in Pythons 3.5 and 3.6?

  • 1. What's New in Pythons 3.5 and 3.6? Viacheslav Kakovskyi Austin Python Meetup 2017 my favourite features
  • 2. Me! @kakovskyi Backend Software Technical Lead Python 2 and Twisted → Python 3 and asyncio Share knowledge at Python events ● PyCon Ukraine 2016 ● PyCon Poland 2016 ● KyivPy 2015, WebCamp Ukraine 2016 2
  • 3. Agenda 1. Syntax changes 2. Library modules 3. Built-in features 4. CPython improvements 5. Standard library improvements 6. Summary 7. Further reading 3
  • 4. Who uses Python 3 in production? 4
  • 5. Who uses Python 3 in production? 5
  • 6. Syntax changes PEP 492 - coroutines with async and await syntax ● async expression used to define coroutine functions ● await is used to suspend coroutine execution until result is available ● implement object.__await__(self) to make your object awaitable 6 Python 3.5 async def http_handler(): users = await get_users_from_db() return '<h1>Online users {}</h1>'.format(len(users))
  • 7. Syntax changes PEP 448 - additional unpacking generalizations ● * expression used as iterable unpacking operator ● and ** as dictionary unpacking operator 7 Python 3.5 >>> print(*[1], *{2}, 3) 1 2 3 >>> print({'x': 4, **{'y': 5}}) {'x': 4, 'y': 5}
  • 8. Syntax changes PEP 515 - underscores in numeric literals 8 Python 3.6 >>> 100_500_000 100500000 >>> 0x_DE_AD_BE_AF 3735928495 >>> '{:_}'1.format(100500000) 100_500_000 >>> '{:_x}'1.format(3735928495) 0x_DE_AD_BE_AF
  • 9. Syntax changes PEP 530 - asynchronous comprehensions ● Now it's possible to use async for in list, set, dict comprehensions and generator expressions ● await and can be used inside the expressions 9 Python 3.6 result = [await fun() for fun in funcs if await condition()]
  • 10. Library modules typing - support of type hints for static code analysis only for functions PEP 526 - add support of type annotation for variables (Py3.6) ● Any, Awaitable Callable, Collection, Coroutine, ● Dict, FrozenSet, Generator, Iterable, Iterator ● List, NewType, Set, Tuple 10 Python 3.5 def greeting(name: str) -> str: return 'Hello, {}'.format(name)
  • 11. Built-in features PEP-461 - percent formatting support for bytes and bytearray 11 Python 3.5 >>> b'Hello, %b' % b'Austin!' b'Hello, Austin!'
  • 12. Built-in features RecursionError is raised when max recursion depth is reached 12 Python 3.5 def recursion(level): # do something awesome return recursion(level+1) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "<stdin>", line 2, in a File "<stdin>", line 2, in a File "<stdin>", line 2, in a [Previous line repeated 995 more times] RecursionError: maximum recursion depth exceeded
  • 13. CPython improvements PEP-488 Elimination of PYO files ● .pyo files are never used ● .pyc files are used with explicit declaration of optimization level in filename 13 Python 3.5 '{name}.{cache_tag}.opt-{optimization}.pyc'.format(name=module_name, cache_tag=sys.implementation.cache_tag, optimization=str(sys.flags.optimize))
  • 14. CPython improvements Compact and ordered dict improvement ● Memory usage is 20% less compared to Python 3.5 ● dict preserves order of insertion now 14 Python 3.6 >>> d = {} >>> d['a'] = 1 >>> d['b'] = 2 >>> d['c'] = 3 >>> d {'a': 1, 'b': 2, 'c': 3}
  • 15. PEP-487 Simpler customization of class creation ● no metaclasses, I promise you ● __init_subclass__ method will be called on base class when a subclass is created CPython improvements 15 Python 3.6
  • 16. ● colection.OrderedDict is implemented in C and just faster ● os.scandir() provides faster way for directory traversal ● functools.lru_cache() has been reimplemented in C ● traceback is more handy for devs and faster too Standard library improvements 16 Python 3.5
  • 17. ● asyncio received new features and considered as stable ● typing has been improved and isn't in provisional state ● tracemalloc provides better output for memory allocation errors ● pathlib has been improved and system path protocol is implemented Standard library improvements 17 Python 3.6
  • 18. Summary ● Use Python 3, asyncio and aiohttp for networking applications 18
  • 19. Further reading ● @kakovskyi ○ Maintaining a high load Python project for newcomers ○ Maintaining a high load Python project: typical mistakes ○ Instant messenger with Python. Back-end development ○ How to easily find the optimal solution without exhaustive search using Genetic Algorithms ● @bmwant ○ Asyncio-stack for web development ○ PEP8 is not enough ○ PyInvoke is your replacement for Makefile 19
  • 21. Senior Platform Developers needed tiny.cc/atlassian_atx 21