Notes
This commit is contained in:
parent
2b7ce615ec
commit
188735d780
3 changed files with 11 additions and 3 deletions
|
@ -4,9 +4,9 @@
|
|||
Python does not require nor enforce strict typing, and instead takes a dynamic
|
||||
approach using [[file:20201008164244-duck_typing.org][Duck Typing]].
|
||||
|
||||
Optional [[file:20201009010321-static_type_checking.org][Static Type Checking]] support for Python is provided via type hints as
|
||||
described in [[pep:0484][PEP-484]] (which covers [[file:20201009010657-nominal_typing.org][Nominal Typing]]) and expanded upon in [[pep:0544][PEP-544]]
|
||||
(which covers [[file:20201008164835-structural_typing.org][Structural Typing]]).
|
||||
[[file:20201010185815-gradual_typing.org][Gradual Typing]] support for Python is provided via type hints as described in
|
||||
[[pep:0484][PEP-484]] (which covers [[file:20201009010657-nominal_typing.org][Nominal Typing]]) and expanded upon in [[pep:0544][PEP-544]] (which covers
|
||||
[[file:20201008164835-structural_typing.org][Structural Typing]]).
|
||||
|
||||
Variables, function arguments, and return values can have their types annotated,
|
||||
e.g. "variable x has type integer" or "function y takes a string and returns a
|
||||
|
@ -26,6 +26,7 @@ program correctness.
|
|||
* Fun facts
|
||||
- Per [[pep:0285][PEP-285]], Python's =boolean= inherits from =int=, hence =True + True = 2=.
|
||||
* Relevant PEPs
|
||||
- [[pep:3107][PEP 3107 -- Function Annotations]]
|
||||
- [[pep:0482][PEP 482 -- Literature Overview for Type Hints]]
|
||||
- [[pep:0483][PEP 483 -- The Theory of Type Hints]]
|
||||
- [[pep:0484][PEP 484 -- Type Hints]]
|
||||
|
|
3
20201010185815-gradual_typing.org
Normal file
3
20201010185815-gradual_typing.org
Normal file
|
@ -0,0 +1,3 @@
|
|||
#+title: Gradual Typing
|
||||
|
||||
A means of supporting both dynamic and static [[file:20201008164956-type_system.org][Type Systems]] within a language.
|
4
JeremySiek2010.org
Normal file
4
JeremySiek2010.org
Normal file
|
@ -0,0 +1,4 @@
|
|||
#+TITLE: What is gradual typing
|
||||
#+ROAM_KEY: cite:JeremySiek2010
|
||||
|
||||
A blog post defining [[file:20201010185815-gradual_typing.org][Gradual Typing]].
|
Loading…
Reference in a new issue