Slide 1

Slide 1 text

What in fact is this Python? Serge Matveenko DataArt twitter.com/lig1

Slide 2

Slide 2 text

Python could be like this

Slide 3

Slide 3 text

Also Python could be like this

Slide 4

Slide 4 text

However we are talking about that Python

Slide 5

Slide 5 text

Disclaimer: a lot of dates here

Slide 6

Slide 6 text

Path to Python 2.0 ● 1980s — 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

Slide 7

Slide 7 text

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 = 2 y += 1 print y == 2 # 0

Slide 8

Slide 8 text

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

Slide 9

Slide 9 text

Python 2.0 → Python 2.5 def 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_nothing def foo(arg): return not arg

Slide 10

Slide 10 text

Zope → Django If you write a custom description always use
for it
Generic KSS Description. Is rendered with class="documentDescription".
{% if latest_question_list %} {% else %}

No polls are available.

{% endif %}

Slide 11

Slide 11 text

Django from django.http import HttpResponse import datetime def current_datetime(request): now = datetime.datetime.now() html = "It is now %s." % now return HttpResponse(html) from django.conf.urls import url from django.contrib import admin urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^posts/$' , views.post_list, name= 'post_list' ), ]

Slide 12

Slide 12 text

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

Slide 13

Slide 13 text

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

Slide 14

Slide 14 text

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)

Slide 15

Slide 15 text

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

Slide 16

Slide 16 text

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

Slide 17

Slide 17 text

Scientific and Numeric ● NumPy ● SciPy ● Pandas ● Jupyter ● PyOpenCL ● Scikit-learn

Slide 18

Slide 18 text

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

Slide 19

Slide 19 text

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

Slide 20

Slide 20 text

Automation ● Ansible ● SaltStack ● fabric ● Bash replacement

Slide 21

Slide 21 text

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

Slide 22

Slide 22 text

Thank you! Serge Matveenko DataArt twitter.com/lig1 t.me/SergeMatveenko