]> git.ipfire.org Git - thirdparty/dnspython.git/commitdiff
Replace dicts with sets.
authorBrian Wellington <bwelling@xbill.org>
Tue, 19 May 2020 17:08:15 +0000 (10:08 -0700)
committerBrian Wellington <bwelling@xbill.org>
Tue, 19 May 2020 17:08:15 +0000 (10:08 -0700)
dns/rdataclass.py
dns/rdatatype.py
dns/tokenizer.py

index 300de40b38fe66fb167351c4509560b5dd3d0284..828812c711b77c58df861ffd0ada061504dd431d 100644 (file)
@@ -36,10 +36,7 @@ class RdataClass(enum.IntEnum):
 
 globals().update(RdataClass.__members__)
 
-_metaclasses = {
-    NONE: True,
-    ANY: True
-}
+_metaclasses = {NONE, ANY}
 
 _unknown_class_pattern = re.compile('CLASS([0-9]+)$', re.I)
 
index 68a5c2b9548f642708e098cd16eaa5d0971251c7..fc8c717399aad934aeab569cf0cac0220e65224d 100644 (file)
@@ -102,17 +102,9 @@ _registered_by_value = {}
 
 globals().update(RdataType.__members__.items())
 
-_metatypes = {
-    OPT: True
-}
-
-_singletons = {
-    SOA: True,
-    NXT: True,
-    DNAME: True,
-    NSEC: True,
-    CNAME: True,
-}
+_metatypes = {OPT}
+
+_singletons = {SOA, NXT, DNAME, NSEC, CNAME}
 
 _unknown_type_pattern = re.compile('TYPE([0-9]+)$', re.I)
 
index 547e030f4f2419fc9387bfcef861a3d93ba31b50..791e99483cca1c1e3859966812c36f8dcd39fb6d 100644 (file)
@@ -24,16 +24,8 @@ import dns.exception
 import dns.name
 import dns.ttl
 
-_DELIMITERS = {
-    ' ': True,
-    '\t': True,
-    '\n': True,
-    ';': True,
-    '(': True,
-    ')': True,
-    '"': True}
-
-_QUOTING_DELIMITERS = {'"': True}
+_DELIMITERS = {' ', '\t', '\n', ';', '(', ')', '"'}
+_QUOTING_DELIMITERS = {'"'}
 
 EOF = 0
 EOL = 1