Stanford Seminar - Optional Static Typing for Python

แชร์
ฝัง
  • เผยแพร่เมื่อ 11 ก.ค. 2024
  • 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 ปีที่แล้ว +4

    Great move, gradual or static typing does in fact reduce debugging time and improves code readability.

  • @stefmeden2820
    @stefmeden2820 2 ปีที่แล้ว

    Great intro to optional static typing for Python, thx

  • @kandhankuhan973
    @kandhankuhan973 6 ปีที่แล้ว +1

    Didn't know Protocol. Awesome!

  • @MichaelScharf
    @MichaelScharf 4 ปีที่แล้ว +5

    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.

  • @ManuelBTC21
    @ManuelBTC21 6 ปีที่แล้ว +1

    Protocols look very similar to Interfaces in golang. Very good choice!

  • @AnthonyMcqueen1987
    @AnthonyMcqueen1987 6 ปีที่แล้ว +6

    This a man i want to meet in person

  • @meditationmusicvideos8924
    @meditationmusicvideos8924 ปีที่แล้ว

    Thanks for your sir

  • @haohuynhnhat3881
    @haohuynhnhat3881 2 ปีที่แล้ว

    It's number one now

  • @MagnusAnand
    @MagnusAnand 4 ปีที่แล้ว

    MyPy is a great!

  • @ManuelBTC21
    @ManuelBTC21 6 ปีที่แล้ว +5

    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 หลายเดือนก่อน

      I just saw Erlang's Joe Armstrong talk, and I think that way of handling errors may be better than static types hmm...

  • @shehab976
    @shehab976 3 ปีที่แล้ว

    23:05 laughed at facebook....only legends will understand🔥🤣

  • @qwertykesthemwel7360
    @qwertykesthemwel7360 6 ปีที่แล้ว +1

    Why not python in dutch?

    • @dimitriosdesmos4699
      @dimitriosdesmos4699 3 ปีที่แล้ว

      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...