]> git.ipfire.org Git - thirdparty/dnspython.git/commit
Enum typing (#923)
authorBrian Wellington <bwelling@xbill.org>
Thu, 6 Apr 2023 13:03:07 +0000 (06:03 -0700)
committerGitHub <noreply@github.com>
Thu, 6 Apr 2023 13:03:07 +0000 (06:03 -0700)
commitcee55728316820d037ece45b11d2fed655a2754c
tree1030a420d5ca24a135b1da6b6237dc2632fa2651
parentc7613943d93986ac23cccff7350c42a32fa5b3bd
Enum typing (#923)

* IntEnum improvements.

This changes make() to always return an instance of the subclass,
creating one on the fly if the value is not known, and updates the typ
registration code to deal with this.  It also adds typing annotations to
make().

* Add missing int check.

Some older versions of python weren't rejecting non-int values.

* Fix int check.

Raise TypeError for non-int, not ValueError, to make tests happy.

* Annotate to_text/from_text.

* Remove many the_ prefixed variables.

These were needed in the past to work around typing issues.
dns/dnssec.py
dns/edns.py
dns/enum.py
dns/message.py
dns/rdata.py
dns/rdataset.py
dns/resolver.py
dns/rrset.py
dns/update.py
dns/zone.py
dns/zonefile.py