On Mon, 16 Nov 2020 19:47:32 +1100 Chris Angelico firstname.lastname@example.org wrote:
def sub(): # Gimme powerz back from __future__ import const BAR: const = 2
SyntaxError: from __future__ imports must occur at the beginning of the file
If it's just a normal symbol imported from a module, it would have to be from something other than __future__.
Right, so the story unfolds: for some time I was thinking that it would be nice to have something like "from __present__ import ...". Or perhaps __lang__. Why, __python__ would work too, if we agree that CPython != Python.
For comparison, in MicroPython, "const" lives in:
from micropython import const
(And originally it's a (pseudo/intrinsic/macro)function, from pre-variable-annotation times:
FOO = const(1)