]> granicus.if.org Git - python/commitdiff
whatsnew/3.5: Briefly mention PEP 484
authorYury Selivanov <yselivanov@sprymix.com>
Tue, 4 Aug 2015 16:46:57 +0000 (12:46 -0400)
committerYury Selivanov <yselivanov@sprymix.com>
Tue, 4 Aug 2015 16:46:57 +0000 (12:46 -0400)
Doc/whatsnew/3.5.rst

index 2c74afecf2c2abb410bf6cd070885db2fe20ca2b..76d57f7c7688315de757bd543aa266250017fae1 100644 (file)
@@ -246,6 +246,28 @@ In dictionaries, later values will always override earlier ones::
    :pep:`448` -- Additional Unpacking Generalizations
 
 
+PEP 484 - Type Hints
+--------------------
+
+This PEP introduces a provisional module to provide these standard
+definitions and tools, along with some conventions for situations
+where annotations are not available.
+
+For example, here is a simple function whose argument and return type
+are declared in the annotations::
+
+  def greeting(name: str) -> str:
+      return 'Hello ' + name
+
+The type system supports unions, generic types, and a special type
+named ``Any`` which is consistent with (i.e. assignable to and from) all
+types.
+
+.. seealso::
+
+   :pep:`484` -- Type Hints
+
+
 PEP 471 - os.scandir() function -- a better and faster directory iterator
 -------------------------------------------------------------------------