Stanford Seminar - Optional Static Typing for Python

  Рет қаралды 27,773

Stanford Online

Stanford Online

Күн бұрын

EE380: Computer Systems Colloquium Seminar
Optional Static Typing for Python
Speaker: Guido van Rossum, Dropbox & Python Software Foundation
Python is a dynamically typed language, and some of its appeal derives from this. Nevertheless, especially for large code bases, it would be nice if a compiler could find type errors before the code is even run. Optional static type checking promises exactly this, and over the past four years we have successfully introduced this feature into Python 3. This talk introduces the type system we've adopted and the syntax used for type annotations, some tips on how to get started with a large existing code base, and our experience using the 'mypy' type checker at Dropbox. The entire system is open source, and has also been adopted by other companies such as Lyft, Quora and Facebook.
About the Speaker:
Guido van Rossum is the creator of Python. Born in the Netherlands, he moved to the US following Python's success. He has worked at various startups and Google, and is currently a Principal Engineer at Dropbox.
For more information about this seminar and its speaker, you can visit ee380.stanford.edu/Abstracts/...
Support for the Stanford Colloquium on Computer Systems Seminar Series provided by the Stanford Computer Forum.
Colloquium on Computer Systems Seminar Series (EE380) presents the current research in design, implementation, analysis, and use of computer systems. Topics range from integrated circuits to operating systems and programming languages. It is free and open to the public, with new lectures each week.
Learn more: bit.ly/WinYX5
0:00 Introduction
0:33 Python's popularity
3:24 Python's type system
10:31 Why dynamic typing
11:42 Why static typing
13:26 Gradual typing
17:30 The mypy project
22:24 Other static type checkers for Python
23:46 A static type system for Python
27:51 Example in Python 2
28:55 Type inference
31:42 How to spell types
36:40 Escape hooks (unsafe)
39:44 Generics
40:55 Generic class example
43:36 Analyzing runtime type checks
48:03 Protocols (PEP 544) (2)
54:05 Stub files and typeshed
55:34 How to start on a large code base
59:06 Standardization effort

Пікірлер: 16
@skepticalmind2260
@skepticalmind2260 6 жыл бұрын
Great move, gradual or static typing does in fact reduce debugging time and improves code readability.
@MichaelScharf
@MichaelScharf 4 жыл бұрын
Please, if your record speakers with slides, put the focus on slides: at 35:51 Guido shows a slide and talks about it, but it is not shown in the video, which is very annoying. The slide is shown at 36:38 for a fraction of a second.
@kandhankuhan973
@kandhankuhan973 6 жыл бұрын
Didn't know Protocol. Awesome!
@stefmeden2820
@stefmeden2820 2 жыл бұрын
Great intro to optional static typing for Python, thx
@AnthonyMcqueen1987
@AnthonyMcqueen1987 6 жыл бұрын
This a man i want to meet in person
@ManuelBTC21
@ManuelBTC21 6 жыл бұрын
Protocols look very similar to Interfaces in golang. Very good choice!
@meditationmusicvideos8924
@meditationmusicvideos8924 Жыл бұрын
Thanks for your sir
@haohuynhnhat3881
@haohuynhnhat3881 2 жыл бұрын
It's number one now
@MagnusAnand
@MagnusAnand 4 жыл бұрын
MyPy is a great!
@shehab976
@shehab976 3 жыл бұрын
23:05 laughed at facebook....only legends will understand🔥🤣
@ManuelBTC21
@ManuelBTC21 6 жыл бұрын
In response to 1:13:00 : python is not a chainsaw. If you have a bug in your homework.py, running it will not cut off your foot. It will throw an error at runtime, or it might even just work, because you didn't go down that codepath. The fact is that a type system is extra work. The payoff is worth it even for medium sized codebases, but there are plenty of use cases where "safety above all else" is the wrong approach.
@AlexRodriguez-gb9ez
@AlexRodriguez-gb9ez 2 ай бұрын
I just saw Erlang's Joe Armstrong talk, and I think that way of handling errors may be better than static types hmm...
@qwertykesthemwel7360
@qwertykesthemwel7360 6 жыл бұрын
Why not python in dutch?
@dimitriosdesmos4699
@dimitriosdesmos4699 4 жыл бұрын
qwerty kesthemwel oh good god, the amount of phlegm one would need just to read 200 line of code in Dutch,......does that answer your question?
@debvdo
@debvdo 6 жыл бұрын
Too bad he is leaving...
Carl Meyer - Type-checked Python in the real world - PyCon 2018
32:10
Talk: Dustin Ingram - Static Typing in Python
21:50
PyCon US
Рет қаралды 16 М.
Mama vs Son vs Daddy 😭🤣
00:13
DADDYSON SHOW
Рет қаралды 43 МЛН
When Python Practices Go Wrong - Brandon Rhodes - code::dive 2019
1:00:51
code::dive conference
Рет қаралды 95 М.
The mind behind Linux | Linus Torvalds | TED
21:31
TED
Рет қаралды 6 МЛН
Keynote: Guido Van Rossum
59:57
Next Day Video
Рет қаралды 124 М.
The Art of Code - Dylan Beattie
1:00:49
NDC Conferences
Рет қаралды 4,7 МЛН
David Beazley - Reinventing the Parser Generator  - PyCon 2018
45:01
Python Hash Sets Explained & Demonstrated - Computerphile
18:39
Computerphile
Рет қаралды 112 М.
The Reason Train Design Changed After 1948
13:05
Joe Scott
Рет қаралды 198 М.
Nature's Incredible ROTATING MOTOR (It’s Electric!) - Smarter Every Day 300
29:37