Jukka Lehtosalo, David Fisher Static Types for Python PyCon 2017

  Рет қаралды 12,004

PyCon 2017

PyCon 2017

Күн бұрын

"Speakers: Jukka Lehtosalo, David Fisher
Over the past year and a half, Dropbox has been investing in the development of mypy, a static type checker for Python, as a way to make our multimillion-line Python codebase easier to understand, navigate, and maintain. In this talk, we will discuss the benefits of type annotations, explain how to use them, and give a peak into how mypy works behind the scenes.
Mypy is an open-source type-checker for Python which supports the PEP 484 standard for gradual typing. Originally created by Jukka Lehtosalo as part of his PhD thesis in 2013, it is now under active development by a small team at Dropbox which includes David Fisher, Greg Price, and Guido van Rossum. It supports Python 3.2 and higher, as well as Python 2.7 (via type comments).
Slides can be found at: speakerdeck.com/pycon2017 and github.com/PyCon/2017-slides"

Пікірлер: 17
@ruthlessadmin
@ruthlessadmin 7 жыл бұрын
Huh. I did not know you could annotate types like that. Very cool!
@TheJaniable
@TheJaniable 3 жыл бұрын
I wish I knew about this before writing 5 entire projects in Python.
@user-zi2zv1jo7g
@user-zi2zv1jo7g 3 ай бұрын
lol
@harshilrastogi
@harshilrastogi 6 жыл бұрын
I can't find the slides at the above-mentioned sources. Can anyone please point me the link?
@jonbarker6979
@jonbarker6979 6 жыл бұрын
print(type(entries)) is how I do it. Why is this better?
@IamEchelon
@IamEchelon 6 жыл бұрын
Python needs a better way to go about doing this because currently this clutters the code up significantly. I would suggest something more Haskell-esque.
@daddy3118
@daddy3118 7 жыл бұрын
I am at 2:20 in and see them using a function without a docstring of any kind as an example. Show how Mypy helps Pythonic code!
@mmmhorsesteaks
@mmmhorsesteaks 7 жыл бұрын
I'm not convinced static typing really helps decently documented code.
@daddy3118
@daddy3118 7 жыл бұрын
mmmhorsesteaks Wheras I'm wary of when an aid becomes a straightjacket. It will also aid those who want to write Java in Python. But then again, what's deemed pythonic _should_ evolve with the addition of new python features.
@mmmhorsesteaks
@mmmhorsesteaks 7 жыл бұрын
Paddy McCarthy i can see this being useful in a corporate setting where you get disjoint teams working on a large project; and ie. language barriers keep you from having good comments... i don't think it's for me is what i'm saying ;-)
@vcool
@vcool 7 жыл бұрын
mmmhorsesteaks, Disjoint teams should just work on different services instead, not on one large code base.
@ruthlessadmin
@ruthlessadmin 7 жыл бұрын
If you watched until 4:55 he went on to explain why docstrings alone don't always help. You're still relying on humans to do their job, and humans are very unreliable. Also, most people really don't care about being "Pythonic". We have deadlines that are far more important. Explicit is better than implicit anyway :)
@adamcunnington2593
@adamcunnington2593 6 жыл бұрын
The introduction is completely flawed. It's completely clear what the code does - or if it isn't, that has nothing to do with static vs. dynamic types. The whole point is, you shouldn't care what the type is. It's irrelevant; the attributes and methods define the behaviour. Talk about completely missing the point.
@desprit
@desprit 6 жыл бұрын
No it is NOT clear. And yes, you SHOULD care about typing.
@user-zi2zv1jo7g
@user-zi2zv1jo7g 3 ай бұрын
Saying this just demonstrates you have never worked with a big enough codebase, just the amount of times I've had to write print type(someUnclearCrap) is worth the strict types
@RubenKelevra
@RubenKelevra 7 жыл бұрын
Well, the introduction is bullshit, your ide can show you the definition of everything, if you use pycharm or similar, just a right click away. They just mess up python...
Eric Evenchick   Hacking Cars with Python   PyCon 2017
29:48
PyCon 2017
Рет қаралды 15 М.
КАК ДУМАЕТЕ КТО ВЫЙГРАЕТ😂
00:29
МЯТНАЯ ФАНТА
Рет қаралды 10 МЛН
Задержи дыхание дольше всех!
00:42
Аришнев
Рет қаралды 3,6 МЛН
Best Toilet Gadgets and #Hacks you must try!!💩💩
00:49
Poly Holy Yow
Рет қаралды 18 МЛН
Looks realistic #tiktok
00:22
Анастасия Тарасова
Рет қаралды 106 МЛН
Carl Meyer - Type-checked Python in the real world - PyCon 2018
32:10
The moment we stopped understanding AI [AlexNet]
17:38
Welch Labs
Рет қаралды 809 М.
Benny Bauer   Python in The Serverless Era   PyCon 2017
30:47
PyCon 2017
Рет қаралды 9 М.
Why Isn't Functional Programming the Norm? - Richard Feldman
46:09
CrowdStrike IT Outage Explained by a Windows Developer
13:40
Dave's Garage
Рет қаралды 2 МЛН
Where Does Bad Code Come From?
42:21
Molly Rocket
Рет қаралды 187 М.
КАК ДУМАЕТЕ КТО ВЫЙГРАЕТ😂
00:29
МЯТНАЯ ФАНТА
Рет қаралды 10 МЛН