SlideShare une entreprise Scribd logo
1  sur  21
Télécharger pour lire hors ligne
Python Update in 2018
1
Who am I ?
• (@cocodrips)
• 

→
• Python / C++ / Go
• Ladies++ 

PyDataTokyo
2
What’s Python?
3
https://www.benfrederickson.com/ranking-programming-languages-by-github-users/
What’s Python?
4https://www.benfrederickson.com/ranking-programming-languages-by-github-users/
What’s Python?
5
• / Web / IoT …
•
•
• Numpy/Scipy/scikit-learn / 

• Tensorflow/Chainer/PyTorch
Recent updates
Recent update
Python 3.0 (2008-12-03)
…
Python 3.6 (2016-12-23)
Python 3.7 (2018-06-27) ← new
7
The pathlib module
PEP 428 (3.4-)
Python3.3
Python3.4
8
>>> import os
>>> root_path = os.path.dirname(os.path.abspath(__file__))
>>> import pathlib
>>> root_path = pathlib.Path(__file__).resolve().parent

The pathlib module
PEP 428 (3.4-)
9
>>> data_path = pathlib.Path(‘data/csv‘)
>>> data_path.mkdir(parents=True, exist_ok=True)
>>> data_path = pathlib.Path('data')
>>> for filename in data_path.glob('**/*.csv'):
... print(filename)
data/csv/data1.csv
data/csv/data2.csv
Adding a file system path protocol
PEP 519 (3.6-)
buildin open() os.path 

pathlib.Path
>>> import pathlib
>>> with open(pathlib.Path("README")) as f:
... contents = f.read()
...
3.6 pathlib
10
Type hints
PEP 484 (3.5-)
def greeting(name: str) -> str:
return 'Hello ' + name
__annotations__
print(greeting.__annotations__)
# {'name': <class 'str'>, 'return': <class 'str'>}
11
Postponed Evaluation of Annotations
PEP 563 (3.7-)


class C:
@classmethod
def from_string(cls, source: str) -> C:
…
import
from __future__ import annotations
12
> “mutable namedtuples with defaults”
Python
__init__, __repr__, __eq__, __ne__, 

__lt__, __le__, __gt____ge__
Data Classes
PEP 557 (3.7-)
13
Data Classes
PEP 557 (3.7-)
14
from typing import List
class User:
name: str
age: int
items: List[int] = None
def __init__(self, name: str, age: int = 0):
self.name = name
self.age = age
self.items = []
def __repr__(self):
return f’{self.__class__.__name__}’
....
user = User('Taro', 10)
# procedue User(name='Taro', age=10, items=[])
Data Classes
PEP 557 (3.7-)
15
from dataclasses import dataclass, field
from typing import List
@dataclass
class User:
name: str
age: int
items: List[int] = field(default_factory=list)
user = User('Taro', 10)
# procedue User(name=‘Taro’, age=10, items=[])
Other especially update
• 3.6
• PEP 498 — Literal String Interpolation ←fstring
• 3.7
• PEP 553 — Built-in breakpoint()
• PEP 567 — Context Variables
16
Future
Retirements of Guido van Rossum
18
I would like to remove myself entirely from the decision process.
I'll still be there for a while as an ordinary core dev,
and I'll still be available to mentor people -- possibly more available.
But I'm basically giving myself a permanent vacation from being BDFL,
and you all will be on your own.
Benevolent Dictator For Life (BDFL) — Guido van Rossum
What’s new in Python 3.8
PEP 569
• 2019 10
• PEP 572 — Assignment Expressions
19
Assignment Expressions
PEP 572 (3.8-)
• :=
•
match = pattern.match(data)
if match:
result = match.group(1)
•
if (match := pattern.search(data)) is not None:
result = match.group(1)
20
Pythonic
Summary
• Pathlib
• TypeHints / DataClasses
• Guido ?Python
• (3.8) Python (:=)
21

Contenu connexe

Tendances

Zero to Hero - Introduction to Python3
Zero to Hero - Introduction to Python3Zero to Hero - Introduction to Python3
Zero to Hero - Introduction to Python3Chariza Pladin
 
Python interview questions for experience
Python interview questions for experiencePython interview questions for experience
Python interview questions for experienceMYTHILIKRISHNAN4
 
A Gentle Introduction to Coding ... with Python
A Gentle Introduction to Coding ... with PythonA Gentle Introduction to Coding ... with Python
A Gentle Introduction to Coding ... with PythonTariq Rashid
 
What is Tuple in python? | Python Tuple Tutorial | Edureka
What is Tuple in python? | Python Tuple Tutorial | EdurekaWhat is Tuple in python? | Python Tuple Tutorial | Edureka
What is Tuple in python? | Python Tuple Tutorial | EdurekaEdureka!
 
Python Interview Questions And Answers
Python Interview Questions And AnswersPython Interview Questions And Answers
Python Interview Questions And AnswersH2Kinfosys
 
James Jesus Bermas on Crash Course on Python
James Jesus Bermas on Crash Course on PythonJames Jesus Bermas on Crash Course on Python
James Jesus Bermas on Crash Course on PythonCP-Union
 
Basic Python Programming: Part 01 and Part 02
Basic Python Programming: Part 01 and Part 02Basic Python Programming: Part 01 and Part 02
Basic Python Programming: Part 01 and Part 02Fariz Darari
 
Python interview questions and answers
Python interview questions and answersPython interview questions and answers
Python interview questions and answerskavinilavuG
 
Everything You Always Wanted to Know About Memory in Python But Were Afraid t...
Everything You Always Wanted to Know About Memory in Python But Were Afraid t...Everything You Always Wanted to Know About Memory in Python But Were Afraid t...
Everything You Always Wanted to Know About Memory in Python But Were Afraid t...Piotr Przymus
 
Everything You Always Wanted to Know About Memory in Python - But Were Afraid...
Everything You Always Wanted to Know About Memory in Python - But Were Afraid...Everything You Always Wanted to Know About Memory in Python - But Were Afraid...
Everything You Always Wanted to Know About Memory in Python - But Were Afraid...Piotr Przymus
 
Python basics_ part1
Python basics_ part1Python basics_ part1
Python basics_ part1Elaf A.Saeed
 
Programming in Python
Programming in Python Programming in Python
Programming in Python Tiji Thomas
 
Intro to Python Programming Language
Intro to Python Programming LanguageIntro to Python Programming Language
Intro to Python Programming LanguageDipankar Achinta
 
What’s eating python performance
What’s eating python performanceWhat’s eating python performance
What’s eating python performancePiotr Przymus
 
Python interview questions and answers
Python interview questions and answersPython interview questions and answers
Python interview questions and answersRojaPriya
 

Tendances (20)

Zero to Hero - Introduction to Python3
Zero to Hero - Introduction to Python3Zero to Hero - Introduction to Python3
Zero to Hero - Introduction to Python3
 
Python interview questions for experience
Python interview questions for experiencePython interview questions for experience
Python interview questions for experience
 
Performance
PerformancePerformance
Performance
 
A Gentle Introduction to Coding ... with Python
A Gentle Introduction to Coding ... with PythonA Gentle Introduction to Coding ... with Python
A Gentle Introduction to Coding ... with Python
 
What is Tuple in python? | Python Tuple Tutorial | Edureka
What is Tuple in python? | Python Tuple Tutorial | EdurekaWhat is Tuple in python? | Python Tuple Tutorial | Edureka
What is Tuple in python? | Python Tuple Tutorial | Edureka
 
Python Interview Questions And Answers
Python Interview Questions And AnswersPython Interview Questions And Answers
Python Interview Questions And Answers
 
Python programming language
Python programming languagePython programming language
Python programming language
 
James Jesus Bermas on Crash Course on Python
James Jesus Bermas on Crash Course on PythonJames Jesus Bermas on Crash Course on Python
James Jesus Bermas on Crash Course on Python
 
Basic Python Programming: Part 01 and Part 02
Basic Python Programming: Part 01 and Part 02Basic Python Programming: Part 01 and Part 02
Basic Python Programming: Part 01 and Part 02
 
Python interview questions and answers
Python interview questions and answersPython interview questions and answers
Python interview questions and answers
 
Everything You Always Wanted to Know About Memory in Python But Were Afraid t...
Everything You Always Wanted to Know About Memory in Python But Were Afraid t...Everything You Always Wanted to Know About Memory in Python But Were Afraid t...
Everything You Always Wanted to Know About Memory in Python But Were Afraid t...
 
Everything You Always Wanted to Know About Memory in Python - But Were Afraid...
Everything You Always Wanted to Know About Memory in Python - But Were Afraid...Everything You Always Wanted to Know About Memory in Python - But Were Afraid...
Everything You Always Wanted to Know About Memory in Python - But Were Afraid...
 
Python basics_ part1
Python basics_ part1Python basics_ part1
Python basics_ part1
 
Python ppt
Python pptPython ppt
Python ppt
 
Programming in Python
Programming in Python Programming in Python
Programming in Python
 
Python basic
Python basicPython basic
Python basic
 
Intro to Python Programming Language
Intro to Python Programming LanguageIntro to Python Programming Language
Intro to Python Programming Language
 
What’s eating python performance
What’s eating python performanceWhat’s eating python performance
What’s eating python performance
 
Python interview questions and answers
Python interview questions and answersPython interview questions and answers
Python interview questions and answers
 
Python
PythonPython
Python
 

Similaire à Python update in 2018 #ll2018jp

Python 3.6 Features 20161207
Python 3.6 Features 20161207Python 3.6 Features 20161207
Python 3.6 Features 20161207Jay Coskey
 
Paver: the build tool you missed
Paver: the build tool you missedPaver: the build tool you missed
Paver: the build tool you missedalmadcz
 
Python于Web 2.0网站的应用 - QCon Beijing 2010
Python于Web 2.0网站的应用 - QCon Beijing 2010Python于Web 2.0网站的应用 - QCon Beijing 2010
Python于Web 2.0网站的应用 - QCon Beijing 2010Qiangning Hong
 
java 8 Hands on Workshop
java 8 Hands on Workshopjava 8 Hands on Workshop
java 8 Hands on WorkshopJeanne Boyarsky
 
Introduction to Python3 Programming Language
Introduction to Python3 Programming LanguageIntroduction to Python3 Programming Language
Introduction to Python3 Programming LanguageTushar Mittal
 
Pygrunn 2012 down the rabbit - profiling in python
Pygrunn 2012   down the rabbit - profiling in pythonPygrunn 2012   down the rabbit - profiling in python
Pygrunn 2012 down the rabbit - profiling in pythonRemco Wendt
 
Computer 10 Quarter 3 Lesson .ppt
Computer 10 Quarter 3 Lesson .pptComputer 10 Quarter 3 Lesson .ppt
Computer 10 Quarter 3 Lesson .pptRedenOriola
 
Python and Oracle : allies for best of data management
Python and Oracle : allies for best of data managementPython and Oracle : allies for best of data management
Python and Oracle : allies for best of data managementLaurent Leturgez
 
Python na Infraestrutura 
MySQL do Facebook

Python na Infraestrutura 
MySQL do Facebook
Python na Infraestrutura 
MySQL do Facebook

Python na Infraestrutura 
MySQL do Facebook
Artur Rodrigues
 
Learn Python 3 for absolute beginners
Learn Python 3 for absolute beginnersLearn Python 3 for absolute beginners
Learn Python 3 for absolute beginnersKingsleyAmankwa
 
Python in 30 minutes!
Python in 30 minutes!Python in 30 minutes!
Python in 30 minutes!Fariz Darari
 
Down the rabbit hole, profiling in Django
Down the rabbit hole, profiling in DjangoDown the rabbit hole, profiling in Django
Down the rabbit hole, profiling in DjangoRemco Wendt
 
PyCon Taiwan 2013 Tutorial
PyCon Taiwan 2013 TutorialPyCon Taiwan 2013 Tutorial
PyCon Taiwan 2013 TutorialJustin Lin
 
Christian Strappazzon - Presentazione Python Milano - Codemotion Milano 2017
Christian Strappazzon - Presentazione Python Milano - Codemotion Milano 2017Christian Strappazzon - Presentazione Python Milano - Codemotion Milano 2017
Christian Strappazzon - Presentazione Python Milano - Codemotion Milano 2017Codemotion
 
30 分鐘學會實作 Python Feature Selection
30 分鐘學會實作 Python Feature Selection30 分鐘學會實作 Python Feature Selection
30 分鐘學會實作 Python Feature SelectionJames Huang
 
Python bootcamp - C4Dlab, University of Nairobi
Python bootcamp - C4Dlab, University of NairobiPython bootcamp - C4Dlab, University of Nairobi
Python bootcamp - C4Dlab, University of Nairobikrmboya
 
جلسه اول پایتون برای هکر های قانونی دوره مقدماتی پاییز ۹۲
جلسه اول پایتون برای هکر های قانونی دوره مقدماتی پاییز ۹۲جلسه اول پایتون برای هکر های قانونی دوره مقدماتی پاییز ۹۲
جلسه اول پایتون برای هکر های قانونی دوره مقدماتی پاییز ۹۲Mohammad Reza Kamalifard
 

Similaire à Python update in 2018 #ll2018jp (20)

Python 3.6 Features 20161207
Python 3.6 Features 20161207Python 3.6 Features 20161207
Python 3.6 Features 20161207
 
Paver: the build tool you missed
Paver: the build tool you missedPaver: the build tool you missed
Paver: the build tool you missed
 
Python于Web 2.0网站的应用 - QCon Beijing 2010
Python于Web 2.0网站的应用 - QCon Beijing 2010Python于Web 2.0网站的应用 - QCon Beijing 2010
Python于Web 2.0网站的应用 - QCon Beijing 2010
 
Intro to Python
Intro to PythonIntro to Python
Intro to Python
 
java 8 Hands on Workshop
java 8 Hands on Workshopjava 8 Hands on Workshop
java 8 Hands on Workshop
 
Introduction to Python3 Programming Language
Introduction to Python3 Programming LanguageIntroduction to Python3 Programming Language
Introduction to Python3 Programming Language
 
Pygrunn 2012 down the rabbit - profiling in python
Pygrunn 2012   down the rabbit - profiling in pythonPygrunn 2012   down the rabbit - profiling in python
Pygrunn 2012 down the rabbit - profiling in python
 
Intro
IntroIntro
Intro
 
Computer 10 Quarter 3 Lesson .ppt
Computer 10 Quarter 3 Lesson .pptComputer 10 Quarter 3 Lesson .ppt
Computer 10 Quarter 3 Lesson .ppt
 
Python and Oracle : allies for best of data management
Python and Oracle : allies for best of data managementPython and Oracle : allies for best of data management
Python and Oracle : allies for best of data management
 
Python na Infraestrutura 
MySQL do Facebook

Python na Infraestrutura 
MySQL do Facebook
Python na Infraestrutura 
MySQL do Facebook

Python na Infraestrutura 
MySQL do Facebook

 
Learn Python 3 for absolute beginners
Learn Python 3 for absolute beginnersLearn Python 3 for absolute beginners
Learn Python 3 for absolute beginners
 
Python in 30 minutes!
Python in 30 minutes!Python in 30 minutes!
Python in 30 minutes!
 
Python Crawler
Python CrawlerPython Crawler
Python Crawler
 
Down the rabbit hole, profiling in Django
Down the rabbit hole, profiling in DjangoDown the rabbit hole, profiling in Django
Down the rabbit hole, profiling in Django
 
PyCon Taiwan 2013 Tutorial
PyCon Taiwan 2013 TutorialPyCon Taiwan 2013 Tutorial
PyCon Taiwan 2013 Tutorial
 
Christian Strappazzon - Presentazione Python Milano - Codemotion Milano 2017
Christian Strappazzon - Presentazione Python Milano - Codemotion Milano 2017Christian Strappazzon - Presentazione Python Milano - Codemotion Milano 2017
Christian Strappazzon - Presentazione Python Milano - Codemotion Milano 2017
 
30 分鐘學會實作 Python Feature Selection
30 分鐘學會實作 Python Feature Selection30 分鐘學會實作 Python Feature Selection
30 分鐘學會實作 Python Feature Selection
 
Python bootcamp - C4Dlab, University of Nairobi
Python bootcamp - C4Dlab, University of NairobiPython bootcamp - C4Dlab, University of Nairobi
Python bootcamp - C4Dlab, University of Nairobi
 
جلسه اول پایتون برای هکر های قانونی دوره مقدماتی پاییز ۹۲
جلسه اول پایتون برای هکر های قانونی دوره مقدماتی پاییز ۹۲جلسه اول پایتون برای هکر های قانونی دوره مقدماتی پاییز ۹۲
جلسه اول پایتون برای هکر های قانونی دوره مقدماتی پاییز ۹۲
 

Plus de cocodrips

Python仮想環境構築の基礎と ツールの比較
Python仮想環境構築の基礎と ツールの比較Python仮想環境構築の基礎と ツールの比較
Python仮想環境構築の基礎と ツールの比較cocodrips
 
スマホでDeepLearning実践入門(α版)
スマホでDeepLearning実践入門(α版)スマホでDeepLearning実践入門(α版)
スマホでDeepLearning実践入門(α版)cocodrips
 
チームメイトのためにdocstringを書こう! pyconjp2019
チームメイトのためにdocstringを書こう! pyconjp2019チームメイトのためにdocstringを書こう! pyconjp2019
チームメイトのためにdocstringを書こう! pyconjp2019cocodrips
 
Docstringを書こう!
Docstringを書こう!Docstringを書こう!
Docstringを書こう!cocodrips
 
C++と仲良くなるためのn問 ~ポインタ編~ #ladiescpp
C++と仲良くなるためのn問 ~ポインタ編~ #ladiescppC++と仲良くなるためのn問 ~ポインタ編~ #ladiescpp
C++と仲良くなるためのn問 ~ポインタ編~ #ladiescppcocodrips
 
Simple is better than complex. ~私がPythonを愛する理由~
Simple is better than complex. ~私がPythonを愛する理由~Simple is better than complex. ~私がPythonを愛する理由~
Simple is better than complex. ~私がPythonを愛する理由~cocodrips
 
ポインタ渡しと参照渡し
ポインタ渡しと参照渡しポインタ渡しと参照渡し
ポインタ渡しと参照渡しcocodrips
 
女性のためのC++コミュニティ Ladies++
女性のためのC++コミュニティ Ladies++女性のためのC++コミュニティ Ladies++
女性のためのC++コミュニティ Ladies++cocodrips
 
強くなるためのプログラミング -プログラミングに関する様々なコンテストとそのはじめ方-#pyconjp
強くなるためのプログラミング -プログラミングに関する様々なコンテストとそのはじめ方-#pyconjp強くなるためのプログラミング -プログラミングに関する様々なコンテストとそのはじめ方-#pyconjp
強くなるためのプログラミング -プログラミングに関する様々なコンテストとそのはじめ方-#pyconjpcocodrips
 
Pythonではじめる競技プログラミング
Pythonではじめる競技プログラミングPythonではじめる競技プログラミング
Pythonではじめる競技プログラミングcocodrips
 

Plus de cocodrips (10)

Python仮想環境構築の基礎と ツールの比較
Python仮想環境構築の基礎と ツールの比較Python仮想環境構築の基礎と ツールの比較
Python仮想環境構築の基礎と ツールの比較
 
スマホでDeepLearning実践入門(α版)
スマホでDeepLearning実践入門(α版)スマホでDeepLearning実践入門(α版)
スマホでDeepLearning実践入門(α版)
 
チームメイトのためにdocstringを書こう! pyconjp2019
チームメイトのためにdocstringを書こう! pyconjp2019チームメイトのためにdocstringを書こう! pyconjp2019
チームメイトのためにdocstringを書こう! pyconjp2019
 
Docstringを書こう!
Docstringを書こう!Docstringを書こう!
Docstringを書こう!
 
C++と仲良くなるためのn問 ~ポインタ編~ #ladiescpp
C++と仲良くなるためのn問 ~ポインタ編~ #ladiescppC++と仲良くなるためのn問 ~ポインタ編~ #ladiescpp
C++と仲良くなるためのn問 ~ポインタ編~ #ladiescpp
 
Simple is better than complex. ~私がPythonを愛する理由~
Simple is better than complex. ~私がPythonを愛する理由~Simple is better than complex. ~私がPythonを愛する理由~
Simple is better than complex. ~私がPythonを愛する理由~
 
ポインタ渡しと参照渡し
ポインタ渡しと参照渡しポインタ渡しと参照渡し
ポインタ渡しと参照渡し
 
女性のためのC++コミュニティ Ladies++
女性のためのC++コミュニティ Ladies++女性のためのC++コミュニティ Ladies++
女性のためのC++コミュニティ Ladies++
 
強くなるためのプログラミング -プログラミングに関する様々なコンテストとそのはじめ方-#pyconjp
強くなるためのプログラミング -プログラミングに関する様々なコンテストとそのはじめ方-#pyconjp強くなるためのプログラミング -プログラミングに関する様々なコンテストとそのはじめ方-#pyconjp
強くなるためのプログラミング -プログラミングに関する様々なコンテストとそのはじめ方-#pyconjp
 
Pythonではじめる競技プログラミング
Pythonではじめる競技プログラミングPythonではじめる競技プログラミング
Pythonではじめる競技プログラミング
 

Dernier

The New Cloud World Order Is FinOps (Slideshow)
The New Cloud World Order Is FinOps (Slideshow)The New Cloud World Order Is FinOps (Slideshow)
The New Cloud World Order Is FinOps (Slideshow)codyslingerland1
 
My key hands-on projects in Quantum, and QAI
My key hands-on projects in Quantum, and QAIMy key hands-on projects in Quantum, and QAI
My key hands-on projects in Quantum, and QAIVijayananda Mohire
 
.NET 8 ChatBot with Azure OpenAI Services.pptx
.NET 8 ChatBot with Azure OpenAI Services.pptx.NET 8 ChatBot with Azure OpenAI Services.pptx
.NET 8 ChatBot with Azure OpenAI Services.pptxHansamali Gamage
 
Automation Ops Series: Session 2 - Governance for UiPath projects
Automation Ops Series: Session 2 - Governance for UiPath projectsAutomation Ops Series: Session 2 - Governance for UiPath projects
Automation Ops Series: Session 2 - Governance for UiPath projectsDianaGray10
 
Design and Modeling for MySQL SCALE 21X Pasadena, CA Mar 2024
Design and Modeling for MySQL SCALE 21X Pasadena, CA Mar 2024Design and Modeling for MySQL SCALE 21X Pasadena, CA Mar 2024
Design and Modeling for MySQL SCALE 21X Pasadena, CA Mar 2024Alkin Tezuysal
 
Planetek Italia Srl - Corporate Profile Brochure
Planetek Italia Srl - Corporate Profile BrochurePlanetek Italia Srl - Corporate Profile Brochure
Planetek Italia Srl - Corporate Profile BrochurePlanetek Italia Srl
 
SIM INFORMATION SYSTEM: REVOLUTIONIZING DATA MANAGEMENT
SIM INFORMATION SYSTEM: REVOLUTIONIZING DATA MANAGEMENTSIM INFORMATION SYSTEM: REVOLUTIONIZING DATA MANAGEMENT
SIM INFORMATION SYSTEM: REVOLUTIONIZING DATA MANAGEMENTxtailishbaloch
 
Stobox 4: Revolutionizing Investment in Real-World Assets Through Tokenization
Stobox 4: Revolutionizing Investment in Real-World Assets Through TokenizationStobox 4: Revolutionizing Investment in Real-World Assets Through Tokenization
Stobox 4: Revolutionizing Investment in Real-World Assets Through TokenizationStobox
 
The Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightThe Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightSafe Software
 
The Importance of Indoor Air Quality (English)
The Importance of Indoor Air Quality (English)The Importance of Indoor Air Quality (English)
The Importance of Indoor Air Quality (English)IES VE
 
How to release an Open Source Dataweave Library
How to release an Open Source Dataweave LibraryHow to release an Open Source Dataweave Library
How to release an Open Source Dataweave Libraryshyamraj55
 
Outage Analysis: March 5th/6th 2024 Meta, Comcast, and LinkedIn
Outage Analysis: March 5th/6th 2024 Meta, Comcast, and LinkedInOutage Analysis: March 5th/6th 2024 Meta, Comcast, and LinkedIn
Outage Analysis: March 5th/6th 2024 Meta, Comcast, and LinkedInThousandEyes
 
How to become a GDSC Lead GDSC MI AOE.pptx
How to become a GDSC Lead GDSC MI AOE.pptxHow to become a GDSC Lead GDSC MI AOE.pptx
How to become a GDSC Lead GDSC MI AOE.pptxKaustubhBhavsar6
 
Q4 2023 Quarterly Investor Presentation - FINAL - v1.pdf
Q4 2023 Quarterly Investor Presentation - FINAL - v1.pdfQ4 2023 Quarterly Investor Presentation - FINAL - v1.pdf
Q4 2023 Quarterly Investor Presentation - FINAL - v1.pdfTejal81
 
March Patch Tuesday
March Patch TuesdayMarch Patch Tuesday
March Patch TuesdayIvanti
 
From the origin to the future of Open Source model and business
From the origin to the future of  Open Source model and businessFrom the origin to the future of  Open Source model and business
From the origin to the future of Open Source model and businessFrancesco Corti
 
Emil Eifrem at GraphSummit Copenhagen 2024 - The Art of the Possible.pptx
Emil Eifrem at GraphSummit Copenhagen 2024 - The Art of the Possible.pptxEmil Eifrem at GraphSummit Copenhagen 2024 - The Art of the Possible.pptx
Emil Eifrem at GraphSummit Copenhagen 2024 - The Art of the Possible.pptxNeo4j
 
Webinar: The Art of Prioritizing Your Product Roadmap by AWS Sr PM - Tech
Webinar: The Art of Prioritizing Your Product Roadmap by AWS Sr PM - TechWebinar: The Art of Prioritizing Your Product Roadmap by AWS Sr PM - Tech
Webinar: The Art of Prioritizing Your Product Roadmap by AWS Sr PM - TechProduct School
 
Where developers are challenged, what developers want and where DevEx is going
Where developers are challenged, what developers want and where DevEx is goingWhere developers are challenged, what developers want and where DevEx is going
Where developers are challenged, what developers want and where DevEx is goingFrancesco Corti
 

Dernier (20)

The New Cloud World Order Is FinOps (Slideshow)
The New Cloud World Order Is FinOps (Slideshow)The New Cloud World Order Is FinOps (Slideshow)
The New Cloud World Order Is FinOps (Slideshow)
 
My key hands-on projects in Quantum, and QAI
My key hands-on projects in Quantum, and QAIMy key hands-on projects in Quantum, and QAI
My key hands-on projects in Quantum, and QAI
 
.NET 8 ChatBot with Azure OpenAI Services.pptx
.NET 8 ChatBot with Azure OpenAI Services.pptx.NET 8 ChatBot with Azure OpenAI Services.pptx
.NET 8 ChatBot with Azure OpenAI Services.pptx
 
Automation Ops Series: Session 2 - Governance for UiPath projects
Automation Ops Series: Session 2 - Governance for UiPath projectsAutomation Ops Series: Session 2 - Governance for UiPath projects
Automation Ops Series: Session 2 - Governance for UiPath projects
 
Design and Modeling for MySQL SCALE 21X Pasadena, CA Mar 2024
Design and Modeling for MySQL SCALE 21X Pasadena, CA Mar 2024Design and Modeling for MySQL SCALE 21X Pasadena, CA Mar 2024
Design and Modeling for MySQL SCALE 21X Pasadena, CA Mar 2024
 
Planetek Italia Srl - Corporate Profile Brochure
Planetek Italia Srl - Corporate Profile BrochurePlanetek Italia Srl - Corporate Profile Brochure
Planetek Italia Srl - Corporate Profile Brochure
 
SheDev 2024
SheDev 2024SheDev 2024
SheDev 2024
 
SIM INFORMATION SYSTEM: REVOLUTIONIZING DATA MANAGEMENT
SIM INFORMATION SYSTEM: REVOLUTIONIZING DATA MANAGEMENTSIM INFORMATION SYSTEM: REVOLUTIONIZING DATA MANAGEMENT
SIM INFORMATION SYSTEM: REVOLUTIONIZING DATA MANAGEMENT
 
Stobox 4: Revolutionizing Investment in Real-World Assets Through Tokenization
Stobox 4: Revolutionizing Investment in Real-World Assets Through TokenizationStobox 4: Revolutionizing Investment in Real-World Assets Through Tokenization
Stobox 4: Revolutionizing Investment in Real-World Assets Through Tokenization
 
The Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightThe Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and Insight
 
The Importance of Indoor Air Quality (English)
The Importance of Indoor Air Quality (English)The Importance of Indoor Air Quality (English)
The Importance of Indoor Air Quality (English)
 
How to release an Open Source Dataweave Library
How to release an Open Source Dataweave LibraryHow to release an Open Source Dataweave Library
How to release an Open Source Dataweave Library
 
Outage Analysis: March 5th/6th 2024 Meta, Comcast, and LinkedIn
Outage Analysis: March 5th/6th 2024 Meta, Comcast, and LinkedInOutage Analysis: March 5th/6th 2024 Meta, Comcast, and LinkedIn
Outage Analysis: March 5th/6th 2024 Meta, Comcast, and LinkedIn
 
How to become a GDSC Lead GDSC MI AOE.pptx
How to become a GDSC Lead GDSC MI AOE.pptxHow to become a GDSC Lead GDSC MI AOE.pptx
How to become a GDSC Lead GDSC MI AOE.pptx
 
Q4 2023 Quarterly Investor Presentation - FINAL - v1.pdf
Q4 2023 Quarterly Investor Presentation - FINAL - v1.pdfQ4 2023 Quarterly Investor Presentation - FINAL - v1.pdf
Q4 2023 Quarterly Investor Presentation - FINAL - v1.pdf
 
March Patch Tuesday
March Patch TuesdayMarch Patch Tuesday
March Patch Tuesday
 
From the origin to the future of Open Source model and business
From the origin to the future of  Open Source model and businessFrom the origin to the future of  Open Source model and business
From the origin to the future of Open Source model and business
 
Emil Eifrem at GraphSummit Copenhagen 2024 - The Art of the Possible.pptx
Emil Eifrem at GraphSummit Copenhagen 2024 - The Art of the Possible.pptxEmil Eifrem at GraphSummit Copenhagen 2024 - The Art of the Possible.pptx
Emil Eifrem at GraphSummit Copenhagen 2024 - The Art of the Possible.pptx
 
Webinar: The Art of Prioritizing Your Product Roadmap by AWS Sr PM - Tech
Webinar: The Art of Prioritizing Your Product Roadmap by AWS Sr PM - TechWebinar: The Art of Prioritizing Your Product Roadmap by AWS Sr PM - Tech
Webinar: The Art of Prioritizing Your Product Roadmap by AWS Sr PM - Tech
 
Where developers are challenged, what developers want and where DevEx is going
Where developers are challenged, what developers want and where DevEx is goingWhere developers are challenged, what developers want and where DevEx is going
Where developers are challenged, what developers want and where DevEx is going
 

Python update in 2018 #ll2018jp

  • 2. Who am I ? • (@cocodrips) • 
 → • Python / C++ / Go • Ladies++ 
 PyDataTokyo 2
  • 5. What’s Python? 5 • / Web / IoT … • • • Numpy/Scipy/scikit-learn / 
 • Tensorflow/Chainer/PyTorch
  • 7. Recent update Python 3.0 (2008-12-03) … Python 3.6 (2016-12-23) Python 3.7 (2018-06-27) ← new 7
  • 8. The pathlib module PEP 428 (3.4-) Python3.3 Python3.4 8 >>> import os >>> root_path = os.path.dirname(os.path.abspath(__file__)) >>> import pathlib >>> root_path = pathlib.Path(__file__).resolve().parent

  • 9. The pathlib module PEP 428 (3.4-) 9 >>> data_path = pathlib.Path(‘data/csv‘) >>> data_path.mkdir(parents=True, exist_ok=True) >>> data_path = pathlib.Path('data') >>> for filename in data_path.glob('**/*.csv'): ... print(filename) data/csv/data1.csv data/csv/data2.csv
  • 10. Adding a file system path protocol PEP 519 (3.6-) buildin open() os.path 
 pathlib.Path >>> import pathlib >>> with open(pathlib.Path("README")) as f: ... contents = f.read() ... 3.6 pathlib 10
  • 11. Type hints PEP 484 (3.5-) def greeting(name: str) -> str: return 'Hello ' + name __annotations__ print(greeting.__annotations__) # {'name': <class 'str'>, 'return': <class 'str'>} 11
  • 12. Postponed Evaluation of Annotations PEP 563 (3.7-) 
 class C: @classmethod def from_string(cls, source: str) -> C: … import from __future__ import annotations 12
  • 13. > “mutable namedtuples with defaults” Python __init__, __repr__, __eq__, __ne__, 
 __lt__, __le__, __gt____ge__ Data Classes PEP 557 (3.7-) 13
  • 14. Data Classes PEP 557 (3.7-) 14 from typing import List class User: name: str age: int items: List[int] = None def __init__(self, name: str, age: int = 0): self.name = name self.age = age self.items = [] def __repr__(self): return f’{self.__class__.__name__}’ .... user = User('Taro', 10) # procedue User(name='Taro', age=10, items=[])
  • 15. Data Classes PEP 557 (3.7-) 15 from dataclasses import dataclass, field from typing import List @dataclass class User: name: str age: int items: List[int] = field(default_factory=list) user = User('Taro', 10) # procedue User(name=‘Taro’, age=10, items=[])
  • 16. Other especially update • 3.6 • PEP 498 — Literal String Interpolation ←fstring • 3.7 • PEP 553 — Built-in breakpoint() • PEP 567 — Context Variables 16
  • 18. Retirements of Guido van Rossum 18 I would like to remove myself entirely from the decision process. I'll still be there for a while as an ordinary core dev, and I'll still be available to mentor people -- possibly more available. But I'm basically giving myself a permanent vacation from being BDFL, and you all will be on your own. Benevolent Dictator For Life (BDFL) — Guido van Rossum
  • 19. What’s new in Python 3.8 PEP 569 • 2019 10 • PEP 572 — Assignment Expressions 19
  • 20. Assignment Expressions PEP 572 (3.8-) • := • match = pattern.match(data) if match: result = match.group(1) • if (match := pattern.search(data)) is not None: result = match.group(1) 20 Pythonic
  • 21. Summary • Pathlib • TypeHints / DataClasses • Guido ?Python • (3.8) Python (:=) 21