declare
- means to tell a name existence to BC so no memory allocation happens because an object isn't created:
- E.g.
v: intanddef func(x: int) -> None: ....
- E.g.
define
- means to declare, then to ask VM to allocate memory in RAM for an object:
- E.g.
v: int = 100anddef func(x: int = 100) -> None: .... -
define includes the meaning of declare because for
v: int = 100, we say only define but not declare, then define.
- E.g.
dynamic type
- is the implicit type always inferred by VM at rtime.
- can be called runtime type but I use dynamic type because it's completely opposite to static type, which is more intuitive.
Top comments (0)