]> git.ipfire.org Git - thirdparty/mkosi.git/commit
Remove annotations import from __future__
authorJoerg Behrmann <behrmann@physik.fu-berlin.de>
Wed, 11 Jan 2023 09:32:33 +0000 (10:32 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 11 Jan 2023 10:51:24 +0000 (11:51 +0100)
commit0f4cf718a14107cb91cd2b22917281bcd88e8d91
tree687c77250f294708ce6a12cf379d8fc4f756bf2e
parent4ba76b45d7ad72d082edc83d871fabad9358be8a
Remove annotations import from __future__

PEP 563 is a PEP that stringifies type annotations. The feature was made
available as opt in. It is still very much in flux or under consideration
upstream and has fallen so much out of favour that the Python steering council
added the note [1]

    PEP 563 Postponed Evaluation of Annotations (the from __future__ import
    annotations future statement) that was originally planned for release in
    Python 3.10 has been put on hold indefinitely. See this message from the
    Steering Council for more information.

in the release notes of CPython 3.11 after punting on accepting the PEP for two
releases. The import does a lot more, but we only use the type
stringification. There is little gain from using this, but with one of the main
features of the import indefinitely on hold, it seems prudent not to use it.

With Python 3.11 the PEP 673 Self type was introduced [2], that will solve this
problem for us, once we move on to 3.11.

[1] https://docs.python.org/3.11/whatsnew/3.11.html#pep-563-may-not-be-the-future
[2] https://docs.python.org/3.11/whatsnew/3.11.html#whatsnew311-pep673
mkosi/__init__.py
mkosi/backend.py