Merken

Type Hints for Python 3.5

Zitierlink des Filmsegments
Embed Code

Automatisierte Medienanalyse

Beta
Erkannte Entitäten
Sprachtranskript
question so I'm going to try to break a personal
record in how fast can go through the slides so tight pants the last time I talked
about this subject a few months ago it was a paper that was a proposal now it's been accepted so
that's good news but I still want to start with a really ancient history uh in 2 thousand 15
years ago there was a type that was already discussing some way of adding type hints for static and and the time optional static typing 2 pi from s as a completely optional way to sort of communicating either between developers or between the developer and the compiler about the types of arguments uh of functions and weak actually sort of 1 of the proposals which I had the time already favorite uh looks exam like the annotation proposal that eventually not accept uh but at the time it was too controversial and I picked it up again in 2004 2005 it series of again incredibly controversial
blog posts that sort of the sky was falling people hated it but at the same time my own thinking about that objects sort of slowly continued and I started introducing things like generic functions and generic types not too much not too long after that I realized that the the whole topic of defining types for argument uh was too controversial to actually introducing Python 3 as such but as a compromise uh we got that 31 0 7 which was accepted
uh which introduce the function annotation syntax with little or no semantics that annotations with the introspective all but otherwise they would be entirely more and this was very much a compromise
approach but intended so that eventually experiments could be carried out like what has happened more recently because the recent history is that a few years ago at quite common in Santa
Clara I meant enterprising young student who was writing here at the time he was writing I think a dialect of that and that he wanted to work has gradually type and I convinced him that if he created the dialect of Python uh his language would be great and it would have 1 user on the other hand I said
if you if you actually 2 week you're syntax and add some compromises and and sort of mess around a little bit so that it fits in with the existing BEP 30 107 syntax then maybe your work will not just the to earn you a doctor but will also be useful for by the community and he actually took that to heart
and I started and experimenting with notations like list square brackets of the uh I also ended up working with him a Dropbox however uh my prize still didn't
seem to be going anywhere until last summer at Europe from Bob Ippolito gave a talk what Python can learn from Haskell and he had like the very specific proposals 2 of which to me seem completely in actionable and the 3rd 1 of which was we should adopt my part so that's sort of inspired me and a few other people including fly-half who drafted the 1st version of caps for typing and this again was an incredibly controversial explosive discussion on Python ideas and afterwards on python does have an outlier c and everywhere else where I didn't want to look but finally assertive in in
my head at least began to GL what this was good for and I met uh someone who had been thinking about this kind of stuff for a while
uh Jeremy sequ where all mentioning a little later so the
architecture that we eventually agreed on and I think my pi was very instrumental here static type-checking is not of functions off the Python interpreter and this is the start of that the sort of big light bulb that went on in my head and in other people's heads uh even you for even for you guys to took a while for this to sort of gel that the 1st
version of my pride that supported Python would actually just run your program and just before running would type checking and then he added a command-line option to only type check it is and then eventually we removed a command line and remove the option to actually run the code we set to run it uses the Python interpreter or my prior whatever might by private and on the other hand if you want to go to be type-checked that's a separate thing just like island is a separate thing it doesn't slow you down at execution time at all uh and this architecture is certainly a lot of things started making sense and this helped certain decide how to how to how to design all little details of the static but the 2nd part of the out architecture
is sort of obvious when using functional annotations of where these type you put them in your code only the type checker cares about them uh the 3rd thing that was really important that was sort of also of somewhat smaller like this you have to have another way of placing type in separately so that the type concerned separated from the code of the
annotate and we call the stub files you can think of them as header files but they're not really the same thing because they're not actually ever use that's uh at execution time the only used by the type checker but
before I go into more detail about all these things why do you actually want a static type a type checker and this sort of
there have been many reasons why people have proposed uh optional static typing for pi farm and some of those reasons were very runtime oriented people were hoping that at runtime the catch functions being called with the wrong argument or people have halted at runtime
a just-in-time compiler could generate better code or maybe sort of module import time type check type annotations could be used to it generate more efficient code this is an idea that for example sigh from actually uses uh albeit with different slightly different notation however real reason why static typing is an important thing is that it it is not that it makes code fast because that's an incredibly complicated the the thing is that it helps to find bugs sooner and the larger your project the more you need things like this and in fact people who have really large old code base is maintained by dozens or hundreds of or thousands of engineers are already within their organization running various things that are in some sense a static type-checker there is an
additional thing that especially in line tiepins help you help when you have a large team working on a large codebase which is that new engineers are really helped by seeing the type hints and it helps them understand the code and it's it's a it's it's in part it's just a communication make mechanism
mechanism from program to program a which in general is always 1 of the criteria are used for designing parts of Python let's see so the type hands in particular help but a type checker by
some is such an incredibly dynamic language there's so many clever hacks where introspected dictionary or module class or use a dynamic attribute Gupta that's very quickly if you do traditional
sort of program X symbolic execution of a program trying to figure out what the types of an argument our uh so that you can then check that that argument is used consistently with the argument types we can even find where the call sites are because everything is dynamic and the might be for different functions named keys and you don't get you can't actually tell which 1 is being called very easily type hands help a static type-checker sort of get overdose there's a little statistic that the authors of by charm uh told me days by charm is an idea that's uh has its own sort of partial type inferencing for Python program so that they can show you not just when you're making syntax errors but also when you're calling things that don't exist or with the wrong number of arguments and it can make decent suggestions about what method started starting with k might occur at a particular point so they tell me that they can correctly infer the type of maybe 50 or 60 per cent of all expressions
in the probe Python program which means that almost half the time they don't know the type of an expression which makes it impossible for them to then give any useful hints doing the check in the case of i of of an idea of course what they have to do in that case is the silence or use a mortar fullback heuristic to give suggestions not say your programs wrong uh but nevertheless
if there were tiepins in a program that could often uh produce more accurate predictions and so on uh I did mention the additional documentation often you find coding conventions at companies that say in in the docstring every argument must be described and the type of every argument must be indicated well if the type of the argument is already part of the syntax you save little space in the docstrings also if you don't have a
docstring and all a document generator can still use the annotations to generate better documentation the so why do we need the stub files why do we need to be able to put the annotations
elsewhere well that the 1st use case that you think of it very quickly is C extensions when you start thinking about static typing anything in Python you realize that there is a huge number of built-in functions
and built-in models for which you also need to have type information and you can serve easily derive you can't easily scan the C code and then figure out what the types of all those functions and classes are so you need to have some done the Python
code that declares the types were for your corresponding built-ins and built-in modules so this is the 1st use case for a stub files the 2nd use case
and served as a series of use cases that have to to do with Python code that you might want to annotate but there's reasons not put the annotations in the code and so it could be that this is just a 3rd party code and you can stick annotations in 3rd party code but now you have made a local model and every time you upgrade that third-party package you have to do that again or as a lot work get
always push uh those changes to the 3rd party because they might not care to might not be maintained you might be using an old release that doesn't get maintained anymore maybe they want to be source compatible with Python 2 and then you you the annotation syntax only exists in Python 3 and so on and so forth there is also there are too many things to to sort of try and annotate everything so stop files are lighter-weight approach to annotating code that for some reason you don't want to annotate in place so when I
presented all these ideas I still get a lot of very sort of critical neg looks a lot of people really like the fact that Python is dynamic and they don't see any reason why they would pollute the code with stuff that in their mind is associated with trouble died languages like Java or C + + well and nevertheless the people who are maintaining very large code bases often have some form of
static analysis they have things that look in the docstrings you some convention for storing types in docstrings and uh end use that in their analysis or they have some kind of static analysis but they don't have they don't have annotations at all not in docstrings nor anywhere else and the type checker just isn't very effective by Lee can only catch so much and so on in some sense what this part whole proposal is actually introducing is more or less just a standard notation that you can use in case you already want that it's very much optional uh in Python 3 5 the 1st version where it's available it's also provision which is a technical term for new
standard library modules and new perhaps in general where we say well we introduced in the standard library but we're reserving the right to sort of changed API for 1 full Python released so in 3 6 the typing module made look a little different perhaps until is
unlikely but it could even look quite different than it looks into In 3 5 and this is something that sort of falls outside the normal guarantees backwards-compatibility you can read out up on this and that for 11 which sort of explains in the finds concept the key thing is that in the . 5 nobody's code will break and my plan is that beyond that we want to break your code either of but
at the same time I do
want to sort of take a position I don't want to say well we have the adaptation syntax without semantics let people this do whatever they want to do they can use my by they want to they can use their own docstring based convention that can put type annotations and decorators let let the BN flowers bloom I think that we've had enough experiments and sort of attempts at doing this that it's better to get everyone decide behind 1 proposals and I was very pleased to see that Google and pie chart for example were both very supportive of this proposal even though they're
not planning to to adopt my pride itself they are planning to adopt this new new syntax some people said well OK maybe you're right maybe we need uh syntax but you can sort of force it down our throat it's right immature and needs to be thought about moral let's wait until 3 . 6 but really that's not gonna help anybody uh if
you wanted notation that uses angular brackets is set of square brackets introducing that is just as hard in the . 6 as it's going to be in 3 . 5 so I sort of any I I started this with what I thought was plenty of lead time we had a large number of very productive discussion
threads uh and I just pushed on everything to to sort of reach a compromise and get something working and so if you were hoping to use this for cogeneration or
if you still believe that type annotations mostly are useful to make your code faster sorry that's not actually very high on my list of use cases uh by by is doing fine without typing we'll see what site onset sigh from I believe can already optionally use uh annotations syntax instead of the traditional site from uh notation maybe Bill prove me wrong but see Python certainly is not going to suddenly run your code faster if
you put annotations in that is not at all part of the plan so there's 1 more thing that 30 7 is now mn not quite 10 years
old maybe it's 8 years old they're definitely people who have used notations creatively and done something completely different with uh here's an example of something I I made this up but I saw something similar where someone had written little little language for marking up functions that would be invokable from some command line uh where annotations specified say the option that name used that's cute uh that's not going to break in the freedom fighters however if you if you run code like that with my in order to type check at my is going to choke on that particular notation because my by expects the annotations to be something else Of course you may not need to run my uh you may not care at all uh or is he other parts of your code you actually do you want to benefit from type checks uh and you you you see think you want to run my pi but you still want to use this particular
notation in some part of your code there is actually a decorator defined in the tab in the paper that you can use to shut up and basically tells my part this function or you can also use it as a class decorated is class uh ignored adaptations because they of they're meant for someone else
OK so that's was mostly an apology and history sort of the the sort of the motivational part of the talk now I'm going to try and outline the bits how this actually works How do you think about type hints uh if you really want to know you should probably start with that for a 3 D which is sort of a simplified theory behind this stuff and but let me go over a few of the basics so uh here's a very simple function in greeting it has an argument with a title and it
returns a tight happens to be both strings and then there's a function that calls the function greeting great does not use annotations greed is not type-checked the the basic idea of gradual typing is that both functions can occur in the same program even in the same module
and uh a type checker is required to accept that code if inside the greeting function there was some use of
uh but the name argument in in in a way that is incompatible with it being a strain type-checker will complain about however in the Green's function where there are no annotations to be seen if you invoke reading it it's not going to perhaps the the biggest thing to to sort of understand is if I could only get the mouse OK well you can see that greed of name clearly name could be anything Prince greeting of names the grating function only accepts a straight however we're not going to get complaints from the type checker that we don't know for sure that names a string in discrete functions and that is sort of that In
case of doubt don't complain that is 1 of the basics of gradual typing and that's that's sort of different from for example in if we were to assume that name given that it has no annotation as a type object then we would actually have a tight violation and his co because good eating doesn't take all objects and object could
be a list of lists is definitely not acceptable uh for greedy at least it's not string so instead of being sort of picky of grid good type-checker using
type hands certain checks thoroughly checks coded has adaptations and backs away from coded does and let's the 2 be combined in a useful way also if the annotated code call something that is annotated it will always just assume that the best possible thing will happen there so this is sort the
principle I think I'm repeating myself here which is unfortunate because that means less time for 4 questions gold
without annotations is always OK to type-checker and there are some hand-wavy things here because there's some so so differences but basically there is magical type named entity which is different from the also somewhat magical type named objects uh and the absence of annotations in 1st approximation can be seen as an annotate everything with the type and and and has a bunch of magic properties and I'll get to that here so any is
confusingly both at the top and the bottom of the class hierarchy ordered type type hockey really uh on the 1 hand if you ask for any object x is an instance of any and this this is of course it's a question of the type checker asks itself it's not a question that you asked at runtime although a user runtime notation here to express and is always to everything is an instance of any also everything that's a class is a subclass of any which really means it's a subtype apologies to market all the other hand and and this is the we we're part and he is also 0 a subclass of every other class uh and and those
physicist you can see I should not try to draw squirrels but I can't draw
a very simple diagram with boxes and lines come with the help of pop help of power point is a very simple class hierarchy it has object which is the built-in object is as number and sequence which happened to be abstract base classes it as known type which is the type of the variable none so now let's add any so any is sort of a superclass of object it's even higher up in the type hierarchy but it's also at the very bottom and if you were to think of this in terms of a classic subclass a relationship everything becomes a matter because
now you can prove that every class in this hierarchy is a subclass of every other class in this hierarchy which completely collapses everything to big money of everything so we don't want that we want this version and there is a separate relationship which is formally called
is consistent with
that's is just like the subclass relationship but special cases any on it to t 1 quarantine 2 positions and you you got this at this point or a and going to ask you to look it up later actually Jeremy seek has a very good uh block post what is gradual typing so
what do we have in our typing module diagonal ply it's a single pure Python module is the only thing that the have actually adds to the standard library uh very easy to ignore and this is where you import things like any uh so again there's no new syntax syntactically we are constrained by the stuff that Python 3 . 4 3 . 2 even can already do uh and with a little clever operator overloading that's actually yeah not such a terrible constraint and we're not actually adding any type annotations to other parts of the standard library so
if you're looking for examples of type you'll you're going to have to look elsewhere but also this typing no pipe itself but can also be installed in Python 3 . 2 or 3 . 3 or 3 . 4 using didn't stop uh what does the typing of pi margin do it defines a whole bunch of magic objects
like any in union and dictum list with capital D and L and that are used for uh expressing types so here's a little example class it's kind of messy there's a chart class and has a function set label and you can see that it's being annotated with some argument types I don't give function bodies now there are also some uh playing functions make labeling get labels are not part of part of the class they're playing functions and I just include them to show that you can uh use a class as a type annotation in somewhat part of the of your code I'm also showing here that you can use the built-in list type that's the type at the bottom you have the variable that argument points which is a list and the function get labels returns list however that is incomplete information because we would like to be
able to express to tell the type checker but about these lists what I what is the type of the elements of these lists and so there is a new notation using
a capitalist and a capital tuple uh which are just some more magic classes that you can import from the typing module uh and now we can say well let's look at the return type 1st the return type is List of string so that is written as capital list square brackets stir square bracket close you can also combine more complicated uh types we can have a tuple of a float in afloat which is a tuple of length 2 each of which item has type float and you can use that as the argument of list type so now we know exactly what the type of that points argument is and we know exactly what the return value it's as you can go 1 step further instead of list you can write ABC's the type module exports modified versions of the standard collection ABC's like it's terrible and you can actually say the argument can be any answerable of tuples of floating float however we still keep the return type this is pretty idiomatic uh type painting the return
types a concrete list because we actually sort of declared that it returns a list and not some other sequence so what exactly happened there typing node
interval it's almost just an alias for collections of ABC interval however it has a little bit of magic behavior uh added to it but it is still usable as a standard ABC in its it's usable in all the contexts where collections of in the seed of the interval is usable but it is also but a type uh the typing not lists type shadows that built in lower case list uh and has some resemblance resemblance to the built ins tuple however it's not an immutable sequence it's more like a structure I have been incredibly
imprecise in my terminology technically we should talk about types when we talk about things that the type checker cares about and classes when we talk about things that happen at runtime the reason that's most of the time things work out fine if you're fuzzy about the distinction is that all classes are usable
as types we define a class that class is always also usable as a type uh however there are a few magic things that are considered types like any in union uh that are classes so in very little
time I've got left uh if we want to have in queue of a complete enumeration of things that can be used as type so anything that's a class can be used as a type there it is generic types list of things but there magic things that they haven't all explained gentle although I've given enough of an explanation of any and you can also define your own generic types the 1st thing that I
haven't mentioned yet which which is pretty pretty standard in a type theory is a union type you could easily have a function that takes either strings or numbers as arguments uh and you might use a union like that a very common special case of unions is an argument that is either a certain type or it's not and we can express that using optional optional doesn't necessarily save you any characters to type but it certainly gives a very clear intention to the human reader the type-checker actually just expands into the union of interval so I already sort of try to explain how to work so it really is a structure with a fixed number of fields each with their given a type sometimes called Cartesian product if you read the academic papers for those people who use tuples as immutable sequences you can say that tuple of some type and then bottle . 3 little dots ellipsis uh that's actually immutable sequence of floats of arbitrary a callable sometimes you
want to say an argument is a function that takes as such and such arguments uh we have annotation for that it's not a very elegant notation but given all our constraints it's the best we can do if you haven't a really complicated arguments signature you can just put an ellipsis there and then it'll take anything then at least you can at least you can still talk about the return type
uh generic classes uh and I cut this short but you define these by deriving from a special thing named generic I'm using a type variable I typed variables have to be defined explicitly using the type for helper functions there collection ABC's like sequence themselves are all generic and can be used this way automatically
and you can also define generic functions again you introduce a type variable type variables can be used like you can you if you only ever need 1 type variable in a particular module you can just use t everywhere don't have to defining new types variable for each function uh this is something I'm going to
skip in favor of more Question Time uh there is a built-in type variable that can express something that is either a string or its which is a very important idea in Python 3 mostly for Python to
backwards compatibility but there we have it uh 0 yeah know we
get into this sort of slightly ugly stuff uh sometimes you have to have a annotation of contains forward reference it needs to it doesn't arguments but the class that is used as arguments type hasn't been defined yet and sort of 1 common example was uh recursive types you could put the whole annotation in string quotes and then the type checker will understand it will sort of evaluate that uh while C Python just sees it as a string uh there are also some cases where you want to annotate variables especially class variables uh that are used as instance variable default since this is very useful uh we have the type comment for that and there's also a cast function if you somehow need to tell the type checker everything's OK don't worry about it so files have a p y I extension uh the bodies in this dump file containing literal literally 3 dots uh is dump files you can define
overloading which is also something I'm going to work skip explaining you can disable your type checks in probably too many different ways but this is to sort of make the people
who don't like typing and or have other uses for the annotation function as
happy as possible and then finally here is a list of alternative syntaxes that uh have been proposed at various
times for it and what we ended up on the left are actually skip this and I do notice that nobody actually proposed return time parameter arguments for callable the reason that we ended up with this somewhat clunky syntax
that's actually in the happened is that it needs to be easy to parse we don't want to introduce any new syntax uh because we want to be able to back port uh type and applied to previous uh by conversions at least 3 point to end up and
we really don't want to have to change of the standard library modules so if you're died
theoretical academic you're probably very unhappy with this proposal but uh we can iterate over the next few years and at least we have the 1st iteration in our hands rather than in the air uh that that was
accepted thank you and
again uh the status is provisional the code is in the . 5 data 1 and I'm very happy that much of the did discussion is behind me so let's start
some more discussion so we don't
really have time for questions but we can make time for questions and if the next speaker can come and the state so I'm now
thinking so 1st thanks I really
like the idea of Taipei inside I'm sure that will will will help us write better or worse more high quality codes but I'm not so sure I like the idea of having 2 options for uh specifying the spike in so in this the file or inside the source code itself that somehow doesn't seem very triphonic that there's 2 options to do 1 thing um and I'm thinking I have also heard some comments from the people that say argument lists will become very long and so the code become harder to read and which you perhaps recommends you always using stoop files as I can see that the IDE scripts perhaps in mind these in in the source file as you are working on it I'm can Q
to wait for the questions to be finished if you want to leave and so we can the answers that was a long question uh my position is that there are really quite a few downsides to stop files uh it's it's sort of difficult to switch back and forth between the stub and the main code and so when you're reading the code you can on the 1 hand the argument list become longer but if you put all the I annotations in the docstring your docstring becomes longer and people are OK with that yeah In many cases the annotations are and actually so Silver boasts some of the examples I gave for example with our are impractical that in practice you would always use a type alias which I forgot to mention you can just say is 8 is some type expression and then after that it is usable as a type alias and so using type aliases you can and make your annotation shorter and also more meaningful and so I think that the the case for in-line annotations is still pretty strong at the same time they're absolutely cases where stubs are the only acceptable solution so we might I think that we we have to have both for fund-raising
like I sorry where's the speed of background so I have to add what I don't know what the proper term would be but effectively arguments to things like list for or a callable during sorry the parameters parameters parameters and in Python we use parentheses to specify parameters that things on why did we make square brackets for these instead
because usually the thing before 2 square brackets is a class and calling a class has already the meaning of instantiating the class to an instance also there is this square brackets certain makes you wonder well what's going on here is something interesting must be going on and uh sort of parameterizing types are something quite different then calling a function or instantiating a class so sort of the square brackets came out because they're notationally sort of they stand out a little bit and yet they are actually already part of existing Python syntax because you can just use we we actually implement the square brackets by overloading get item on the on the metaclass and that would be the last question of so I have 2 questions
section but not the 1st person who really and this is there any way to express the bargains and contravariance yes
I didn't get to this but it is in the perhaps you can have variant and invariant co-variance convariance type contravariant typed variables lands the default is invariant 2nd good question how group
Mary which uh types were like floats things can I past and into a float over or that is currently done by a
little bit of a special case in in the type checker so that is the specification says float and the actual value is and that's actually considered a subtype acceptable what we did and we don't have here thank color hair
Roboter
Parametersystem
Typentheorie
Pauli-Prinzip
Compiler
Güte der Anpassung
Reihe
Red Hat
Quick-Sort
Computeranimation
Web log
Konfiguration <Informatik>
Rechenschieber
Hydrostatik
Datensatz
Funktion <Mathematik>
Typentheorie
Softwareentwickler
Baum <Mathematik>
Lineares Funktional
Parametersystem
Typentheorie
Web log
Pauli-Prinzip
Quick-Sort
Computeranimation
Formale Semantik
Objekt <Kategorie>
Generizität
Funktion <Mathematik>
Typentheorie
Baum <Mathematik>
Portscanner
Typentheorie
Pauli-Prinzip
Typentheorie
Formale Sprache
t-Test
Baum <Mathematik>
Dialekt
Computeranimation
Portscanner
Poisson-Klammer
Zahlensystem
Quadratzahl
Pauli-Prinzip
Typentheorie
Vorlesung/Konferenz
Mailing-Liste
Baum <Mathematik>
Quick-Sort
Computeranimation
Portscanner
Pauli-Prinzip
Typentheorie
Mereologie
Versionsverwaltung
Explosion <Stochastik>
Baum <Mathematik>
Quick-Sort
Computeranimation
Schreib-Lese-Kopf
Kugelkappe
Magnetbandlaufwerk
Lineares Funktional
Interpretierer
Softwareentwickler
Elektronische Publikation
Typprüfung
Pauli-Prinzip
Ablöseblase
Mathematisierung
Ikosaeder
Quick-Sort
Computeranimation
Portscanner
Funktion <Mathematik>
Code
Typentheorie
Computerarchitektur
Schreib-Lese-Kopf
Magnetbandlaufwerk
Interpretierer
Typentheorie
Softwareentwickler
Elektronische Publikation
Ablöseblase
Versionsverwaltung
Mathematisierung
Rechenzeit
Code
Quick-Sort
Computeranimation
Konfiguration <Informatik>
Funktion <Mathematik>
Typentheorie
Code
Mereologie
Computerarchitektur
Optimierung
Baum <Mathematik>
Magnetbandlaufwerk
Tropfen
Lineares Funktional
Typentheorie
Softwareentwickler
Ablöseblase
Mathematisierung
Rechenzeit
Ikosaeder
Ausnahmebehandlung
Elektronische Publikation
Analysis
Computeranimation
Konfiguration <Informatik>
Hydrostatik
Quader
Funktion <Mathematik>
Code
Typentheorie
Biprodukt
E-Mail
Baum <Mathematik>
Magnetbandlaufwerk
Telekommunikation
Typentheorie
Selbst organisierendes System
Ikosaeder
Code
Analysis
Computeranimation
Zahlensystem
Code
Typentheorie
Statistische Analyse
Biprodukt
Gerade
Kraftfahrzeugmechatroniker
Tropfen
Typprüfung
Just-in-Time-Compiler
Modul
Quick-Sort
Programmfehler
Quader
Mereologie
Projektive Ebene
Baum <Mathematik>
Magnetbandlaufwerk
Typentheorie
Web Site
Punkt
Formale Sprache
Zahlenbereich
NP-hartes Problem
Computeranimation
Hydrostatik
Arithmetischer Ausdruck
Interaktives Fernsehen
Code
Typentheorie
Hacker
Optimierung
Hilfesystem
Attributierte Grammatik
Autorisierung
Kraftfahrzeugmechatroniker
Lineares Funktional
Parametersystem
Statistik
Typprüfung
Diskretes System
Systemaufruf
Symboltabelle
Programmierumgebung
Partielle Differentiation
Quick-Sort
Mereologie
Datenfluss
Schlüsselverwaltung
Baum <Mathematik>
Fehlermeldung
Magnetbandlaufwerk
Parametersystem
Typentheorie
Varianz
NP-hartes Problem
Programmierumgebung
Raum-Zeit
Computeranimation
Arithmetischer Ausdruck
Prognoseverfahren
Interaktives Fernsehen
Typentheorie
Code
Mereologie
Datenfluss
Optimierung
Baum <Mathematik>
Hydrostatik
Lineares Funktional
Informationsmodellierung
Typentheorie
Elektronische Publikation
Code
Klasse <Mathematik>
Mathematisierung
Zahlenbereich
Maßerweiterung
Information
Maßerweiterung
Elektronische Publikation
Code
Computeranimation
Informationsmodellierung
Multifunktion
Typentheorie
Elektronische Publikation
Code
Reihe
Mathematisierung
Maßerweiterung
Drei
Modul
Code
Computeranimation
Code
Typentheorie
Formale Sprache
Applet
Mathematisierung
Stützpunkt <Mathematik>
Ikosaeder
Quellcode
Elektronische Publikation
Zahlensystem
Analysis
Code
Quick-Sort
Computeranimation
Typentheorie
Versionsverwaltung
Ikosaeder
Modul
Analysis
Quick-Sort
Computeranimation
Hydrostatik
Zahlensystem
Rechter Winkel
Code
Typentheorie
Mereologie
Programmbibliothek
Reelle Zahl
Chi-Quadrat-Verteilung
Analysis
Standardabweichung
Systemprogrammierung
Pauli-Prinzip
Standardabweichung
Typentheorie
Automatische Handlungsplanung
Normalvektor
Zahlensystem
Quick-Sort
Code
Computeranimation
RFID
Typentheorie
Ortsoperator
Pauli-Prinzip
Zahlensystem
Quick-Sort
Kreisdiagramm
Computeranimation
RFID
Entscheidungstheorie
Formale Semantik
Systemprogrammierung
Forcing
Standardabweichung
Typentheorie
Anpassung <Mathematik>
CMM <Software Engineering>
Hilfesystem
Systemprogrammierung
Zahlensystem
Poisson-Klammer
Pauli-Prinzip
Standardabweichung
Typentheorie
Zahlenbereich
Thread
Zahlensystem
Quick-Sort
Computeranimation
RFID
Portscanner
Mailing-Liste
Typentheorie
Zahlensystem
Web Site
Codegenerierung
Typentheorie
Mereologie
Automatische Handlungsplanung
Kraft
Mailing-Liste
Code
Computeranimation
Lineares Funktional
Typentheorie
Pauli-Prinzip
Klasse <Mathematik>
Singularität <Mathematik>
Domänenspezifische Programmiersprache
Code
Computeranimation
Konfiguration <Informatik>
Portscanner
Zahlensystem
Funktion <Mathematik>
Typentheorie
Mereologie
Anpassung <Mathematik>
Vorlesung/Konferenz
Ordnung <Mathematik>
Lineares Funktional
Parametersystem
Bit
Typentheorie
Feldgleichung
Modul
Quick-Sort
Physikalische Theorie
Computeranimation
Bit
Code
Typentheorie
Mereologie
Optimierung
Zeichenkette
Modul
Parametersystem
Lineares Funktional
Folge <Mathematik>
Typentheorie
Typprüfung
Green-Funktion
Code
Typentheorie
PRINCE2
Quick-Sort
Computeranimation
Zeichenkette
Objekt <Kategorie>
Subtraktion
Typentheorie
Typprüfung
Code
Typentheorie
Güte der Anpassung
Vorlesung/Konferenz
Mailing-Liste
Baum <Mathematik>
Quick-Sort
Computeranimation
Magnetbandlaufwerk
Typentheorie
Subtraktion
Approximation
Typprüfung
Kategorie <Mathematik>
Systemaufruf
Code
Quick-Sort
Computeranimation
Objekt <Kategorie>
Zustandsdichte
Code
Typentheorie
Anpassung <Mathematik>
Baum <Mathematik>
Typentheorie
Physiker
Klasse <Mathematik>
Rechenzeit
Hierarchische Struktur
Objektklasse
Computeranimation
Objekt <Kategorie>
Zahlensystem
Minimum
Mereologie
Vererbungshierarchie
Minimum
Cloud Computing
Instantiierung
Folge <Mathematik>
Typentheorie
Punkt
Quader
Abstraktionsebene
Klasse <Mathematik>
Versionsverwaltung
Zahlenbereich
Hierarchische Struktur
Objektklasse
Term
Quick-Sort
Computeranimation
Objekt <Kategorie>
Diagramm
Vererbungshierarchie
Cloud Computing
Große Vereinheitlichung
Gerade
Hilfesystem
Leistung <Physik>
Nichtlinearer Operator
Typentheorie
Mereologie
Punkt
Ortsoperator
Einfache Genauigkeit
Gradient
p-Block
Modul
Variable
Computeranimation
Web log
Gruppenoperation
Portscanner
Mailing-Liste
Typprüfung
Modul <Datentyp>
Typentheorie
Mereologie
Vererbungshierarchie
Programmbibliothek
Gravitationsgesetz
Diagonale <Geometrie>
Modul
Magnetbandlaufwerk
Randverteilung
Lineares Funktional
Parametersystem
Typentheorie
Mereologie
Punkt
Klasse <Mathematik>
Mailing-Liste
Code
Computeranimation
Objekt <Kategorie>
Mailing-Liste
Vollkommene Information
Typprüfung
Modul <Datentyp>
Typentheorie
Mereologie
Minimum
Vorlesung/Konferenz
Baum <Mathematik>
Modul
Parametersystem
Dicke
Typentheorie
Punkt
Singularität <Mathematik>
Klasse <Mathematik>
Versionsverwaltung
n-Tupel
Abgeschlossene Menge
Mailing-Liste
Element <Mathematik>
Modul
Computeranimation
Mailing-Liste
Zahlensystem
Poisson-Klammer
Uniforme Struktur
Quadratzahl
Bit
Schwimmkörper
Baum <Mathematik>
Zeichenkette
Standardabweichung
Aliasing
Typentheorie
Folge <Mathematik>
Bit
Gruppe <Mathematik>
Benutzerfreundlichkeit
Mailing-Liste
Abstraktionsebene
Kontextbezogenes System
Intelligentes Netz
Quick-Sort
Computeranimation
Knotenmenge
Bit
Abschattung
Vorlesung/Konferenz
Datenstruktur
Baum <Mathematik>
Typentheorie
Typprüfung
Funktion <Mathematik>
Typentheorie
Klasse <Mathematik>
Rechenzeit
Vorlesung/Konferenz
Objektklasse
Baum <Mathematik>
Computeranimation
Typentheorie
Folge <Mathematik>
Konfiguration <Informatik>
Klasse <Mathematik>
n-Tupel
Zahlenbereich
Abstraktionsebene
Kartesisches Produkt
Computeranimation
Metropolitan area network
Abzählen
Typentheorie
Warteschlange
Datenstruktur
Lineares Funktional
Parametersystem
Vervollständigung <Mathematik>
Typprüfung
Division
Mailing-Liste
Quick-Sort
Portscanner
Generizität
Skalarprodukt
Datenfeld
Zeichenkette
Portscanner
Lineares Funktional
Nebenbedingung
Parametersystem
Variable
Folge <Mathematik>
Zahlensystem
Typentheorie
Funktion <Mathematik>
Typentheorie
Klasse <Mathematik>
Varianz
Cloud Computing
Objektklasse
Elektronische Unterschrift
Computeranimation
Magnetbandlaufwerk
Lineares Funktional
Typentheorie
Varianz
Ikosaeder
Modul
Computeranimation
Variable
Mailing-Liste
Funktion <Mathematik>
Typentheorie
Ideal <Mathematik>
Zeichenkette
Parametersystem
Lineares Funktional
Typentheorie
Klasse <Mathematik>
Varianz
Maßerweiterung
Elektronische Publikation
Variable
Quick-Sort
Auswahlverfahren
Computeranimation
Zeichenkette
Variable
Skalarprodukt
Funktion <Mathematik>
Modul <Datentyp>
Typentheorie
ATM
Konstante
Speicherabzug
Maßerweiterung
Default
Zeichenkette
Instantiierung
Magnetbandlaufwerk
Lineares Funktional
Parametersystem
Typentheorie
Elektronische Publikation
Pauli-Prinzip
Mailing-Liste
Objektklasse
Variable
Computeranimation
Mailing-Liste
Typentheorie
Äußere Algebra eines Moduls
Multitasking
Magnetbandlaufwerk
Data Encryption Standard
Umsetzung <Informatik>
Typentheorie
Punkt
PASS <Programm>
Iteration
Parser
Modul
Widerspruchsfreiheit
Computeranimation
Modul <Datentyp>
Typentheorie
Code
Programmbibliothek
Restklasse
Typsystem
Standardabweichung
Pauli-Prinzip
Verschlingung
Betafunktion
Zoom
Vorlesung/Konferenz
Baum <Mathematik>
Chatbot
Code
Computeranimation
Gammafunktion
Web log
Aggregatzustand
Binärdaten
Parametersystem
Mailing-Liste
Quellcode
Elektronische Publikation
Code
Computeranimation
Konfiguration <Informatik>
Web log
Verschlingung
Codierung
Zoom
Skript <Programm>
Programmierumgebung
Aliasing
Parametersystem
Typentheorie
Ortsoperator
Mailing-Liste
Elektronische Publikation
Term
Code
Computeranimation
Web log
Arithmetischer Ausdruck
Poisson-Klammer
Verschlingung
Zoom
Vorlesung/Konferenz
Gammafunktion
Data Encryption Standard
Lineares Funktional
Bit
Typentheorie
Gruppe <Mathematik>
Klasse <Mathematik>
Quick-Sort
Computeranimation
Web log
Arithmetisches Mittel
Poisson-Klammer
Verschlingung
Mereologie
Zoom
Garbentheorie
Instantiierung
Funktor
Software Development Kit
Umwandlungsenthalpie
Typentheorie
Bit
Invarianz
Gruppenkeim
Extrempunkt
Computeranimation
Web log
Metropolitan area network
Variable
Zustandsdichte
Verschlingung
Datenerfassung
Zoom
Schwimmkörper
Kantenfärbung
Default
Baum <Mathematik>
Funktor
Roboter
Metropolitan area network
Red Hat
Computeranimation

Metadaten

Formale Metadaten

Titel Type Hints for Python 3.5
Serientitel EuroPython 2015
Teil 69
Anzahl der Teile 173
Autor Rossum, Guido van
Lizenz CC-Namensnennung - keine kommerzielle Nutzung - Weitergabe unter gleichen Bedingungen 3.0 Unported:
Sie dürfen das Werk bzw. den Inhalt zu jedem legalen und nicht-kommerziellen Zweck nutzen, verändern und in unveränderter oder veränderter Form vervielfältigen, verbreiten und öffentlich zugänglich machen, sofern Sie den Namen des Autors/Rechteinhabers in der von ihm festgelegten Weise nennen und das Werk bzw. diesen Inhalt auch in veränderter Form nur unter den Bedingungen dieser Lizenz weitergeben
DOI 10.5446/20121
Herausgeber EuroPython
Erscheinungsjahr 2015
Sprache Englisch
Produktionsort Bilbao, Euskadi, Spain

Inhaltliche Metadaten

Fachgebiet Informatik
Abstract Guido van Rossum - Type Hints for Python 3.5 PEP 484, "Type Hints", was accepted in time for inclusion in Python 3.5 beta 1. This introduces an optional standard for specifying types in function signatures. This concept was previously discussed as "optional static typing" and I similar to the way TypeScript adds optional type declarations to JavaScript. In this talk I will discuss the motivation for this work and show the key elements of the DSL for describing types (which, by the way is backward compatible with Python 3.2, 3.3 and 3.4). Note: *Python will remain a dynamically typed language, and I have no desire to ever make type hints mandatory, even by convention!*
Schlagwörter EuroPython Conference
EP 2015
EuroPython 2015

Ähnliche Filme

Loading...