3 ms·
There's no such thing as "dynamic types". A type is by definition associated with an expression in a language, but those expressions are part of the program's s
by lmm 6y ago
There's no such thing as "dynamic types". A type is by definition associated with an expression in a language, but those expressions are part of the program's static source code. Python has some kind of checking of the runtime values involved in certain operations, but that's not typing.
- HelloNurse 6y agoTypes are not associated with expressions in Python: evaluating an expression produces a typed value, whose type, and not only its value, depends on the type and/or values of the inputs. Example: def comparativeInsult(a,b): if b>a: return "try again" if a>b: return a/b else: return None The type is, for all practical purposes, a part of the value of a Python object.
- lmm 6y agoSuch a thing is not a type. Not by the usual definition, which predates not only python but mechanical computation.