+ All Categories
Home > Data & Analytics > IT talk "Python language evolution"

IT talk "Python language evolution"

Date post: 20-Mar-2017
Category:
Upload: dataart
View: 28 times
Download: 0 times
Share this document with a friend
22
А какой на самом деле этот Python? Сергей Матвеенко DataArt twitter.com/lig1
Transcript
Page 1: IT talk "Python language evolution"

А какой на самом делеэтот Python?

Сергей МатвеенкоDataArt

twitter.com/lig1

Page 2: IT talk "Python language evolution"

Python может быть такой

Page 3: IT talk "Python language evolution"

А еще Python может быть такой

Page 4: IT talk "Python language evolution"

Но мы про такой Python

Page 5: IT talk "Python language evolution"

Предупреждение: здесь будет много дат

Page 6: IT talk "Python language evolution"

Path to Python 2.0● 1980-е — ABC — “Centrum Wiskunde & Informatica”● December 1989 — Guido van Rossum “Centrum Wiskunde & Informatica”● February, 1991 — Python 0.9.0● January, 1994 — Python 1.0● 1995 — Python 1.2● “Corporation for National Research Initiatives”● May, 2000 — Independent development● September, 2000 — Python 1.6 — last at CNRI● September, 2000 — Python 2.0 — the first modern

Page 7: IT talk "Python language evolution"

Python 2.0● SourceForge● PEPs● Unicode● List Comprehensions● Augmented Assignment `+=`, `-=` , …● String Methods `s.join(seq)`● gc module● apply(f, args, kw) → f(*args, **kwargs)● `print >> sys.stderr, "Hello"`● `zip()`● `from distutils.core import setup`● codecs, zipfile, mmap, xml.sax, xml.dom

foo = [0, 2, 1]

bar = [x for x in foo if x]

y = 2y += 1

print y == 2 # 0

Page 8: IT talk "Python language evolution"

Python 2.0 → Python 2.5

● Python 2.1 - April 17, 2001○ unittest

● Python 2.3 - July 29, 2003○ PEP 285 -- Adding a bool type

● Python 2.4 - November 30, 2004○ PEP 318 -- Decorators for Functions and

Methods

● Python 2.5 - September 19, 2006○ PEP 308 -- Conditional Expressions

● Zope 2 - 1998

● Zope 3 / BlueBream - 2004

● Django - July 21, 2005

Page 9: IT talk "Python language evolution"

Python 2.0 → Python 2.5def bool_or_nothing(func):

def wrapper(arg): if arg in [0, 1]: return func(arg) else: return None

return wrapper

def foo(arg): return not arg

foo = bool_or_nothing(foo)

def bool_or_nothing(func):

def wrapper(arg): return ( func(arg) if isinstance(arg, bool) else None)

return wrapper

@bool_or_nothingdef foo(arg): return not arg

Page 10: IT talk "Python language evolution"

Zope → Django

<metal:description define-slot="content-description" ><metal:comment tal:content="nothing">If you write a custom description always use <div

class="documentDescription" ></div> for it</metal:comment><div metal:use-macro= "context/kss_generic_macros/macros/generic_description_view" >Generic

KSS Description. Is rendered with class="documentDescription". </div></metal:description>

{% if latest_question_list %} <ul> {% for question in latest_question_list %} <li><a href="/polls/{{ question.id }}/">{{ question.question_text }}</a></li> {% endfor %} </ul>{% else %} <p>No polls are available. </p>{% endif %}

Page 11: IT talk "Python language evolution"

Django

from django.http import HttpResponseimport datetime

def current_datetime(request): now = datetime.datetime.now() html = "<html><body>It is now %s.</body></html>" % now return HttpResponse(html)

from django.conf.urls import urlfrom django.contrib import admin

urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^posts/$', views.post_list, name= 'post_list'),]

Page 12: IT talk "Python language evolution"

Six - Pre-Modern Era● Python 2.6 - October 1, 2008

○ PEP 343 -- The "with" Statement○ PEP 3129 -- Class Decorators○ multiprocessing

● Python 3.0 - December 3, 2008○ PEP 3107 -- Function Annotations○ PEP 3129 -- Class Decorators

● Python 2.7 - July 3, 2010○ More Python 3 compatibility

● Python 3.2 - February 20, 2011○ The first mature

● Pypy - 2008

● Zope Five - 2009● Pytest - Aug 4, 2009

● Flask - April 1, 2010

● Six - Mar 15, 2011● Pip - April 4, 2011

Page 13: IT talk "Python language evolution"

Python 3 — Modern Era● Python 3.3 - September 29, 2012

○ PEP 380 -- Syntax for Delegating to a Subgenerator

○ PEP 414 -- Explicit Unicode Literal for Python 3.3

● Python 3.4 - March 16, 2014○ asyncio

● Python 3.5 - September 13, 2015○ PEP 484 -- Type Hints○ PEP 492 -- Coroutines with async and

await syntax● Python 3.6 - December 23, 2016

○ PEP 526 -- Syntax for Variable Annotations

○ PEP 525 -- Asynchronous Generators○ PEP 628 -- Add math.tau

● Mypy - Dec 7, 2012

● Pypy3 - June 20, 2014

Page 14: IT talk "Python language evolution"

It's a kind of magic

async def ping_server(ip: str): # ping code here...

async def ping_local(): async with connection.connect(): ip: str = await connection.get_ip() return await ping_server(ip)

Page 15: IT talk "Python language evolution"

Why Python?

● Web Development● Scientific and Numeric● Education● Desktop GUIs● 3D Modelling● Q&A● Automation● Embedded Systems

Page 16: IT talk "Python language evolution"

Web development

● Django● Flask● Tornado● Plone● aiohttp● requests● bottle● WebOb

Page 17: IT talk "Python language evolution"

Scientific and Numeric

● NumPy● SciPy● Pandas● Jupyter● PyOpenCL● Scikit-learn

Page 18: IT talk "Python language evolution"

Education

● Tutorials● Books● Videos● Academic papers● pygame● …● Raspberry Pi

Page 19: IT talk "Python language evolution"

Desktop GUIs

● PyQT● GTK● Tkinter● wxWidgets● Kivy (mobile apps)

Page 20: IT talk "Python language evolution"

Automation

● Ansible● SaltStack● fabric● Bash replacement

Page 21: IT talk "Python language evolution"

Why Python?

● Web Development● Scientific and Numeric● Education● Desktop GUIs● 3D Modelling● Q&A● Automation● Embedded Systems

Page 22: IT talk "Python language evolution"

Спасибо!

Сергей МатвеенкоDataArt

twitter.com/lig1


Recommended