/
usr
/
lib
/
python3.9
/
site-packages
/
dns
/
/usr/lib/python3.9/site-packages/dns
mkdir
upload
Name
Size
Mode
Actions
dnssecalgs/
-
0755
rm
quic/
-
0755
rm
rdtypes/
-
0755
rm
__pycache__/
-
0755
rm
asyncbackend.py
2796
0644
edit
dl
rm
asyncquery.py
26850
0644
edit
dl
rm
asyncresolver.py
17852
0644
edit
dl
rm
dnssec.py
40693
0644
edit
dl
rm
dnssectypes.py
1799
0644
edit
dl
rm
e164.py
3978
0644
edit
dl
rm
edns.py
15263
0644
edit
dl
rm
entropy.py
4242
0644
edit
dl
rm
enum.py
3691
0644
edit
dl
rm
exception.py
5957
0644
edit
dl
rm
flags.py
2750
0644
edit
dl
rm
grange.py
2148
0644
edit
dl
rm
immutable.py
2017
0644
edit
dl
rm
inet.py
5772
0644
edit
dl
rm
ipv4.py
2552
0644
edit
dl
rm
ipv6.py
6600
0644
edit
dl
rm
message.py
65993
0644
edit
dl
rm
name.py
42672
0644
edit
dl
rm
namedict.py
4000
0644
edit
dl
rm
nameserver.py
9909
0644
edit
dl
rm
node.py
12663
0644
edit
dl
rm
opcode.py
2730
0644
edit
dl
rm
query.py
54832
0644
edit
dl
rm
rcode.py
4156
0644
edit
dl
rm
rdata.py
29456
0644
edit
dl
rm
rdataclass.py
2984
0644
edit
dl
rm
rdataset.py
16756
0644
edit
dl
rm
rdatatype.py
7339
0644
edit
dl
rm
renderer.py
11254
0644
edit
dl
rm
resolver.py
73552
0644
edit
dl
rm
reversename.py
3828
0644
edit
dl
rm
rrset.py
9170
0644
edit
dl
rm
serial.py
3606
0644
edit
dl
rm
set.py
9088
0644
edit
dl
rm
tokenizer.py
23583
0644
edit
dl
rm
transaction.py
22636
0644
edit
dl
rm
tsig.py
11413
0644
edit
dl
rm
tsigkeyring.py
2633
0644
edit
dl
rm
ttl.py
2979
0644
edit
dl
rm
update.py
12243
0644
edit
dl
rm
version.py
1926
0644
edit
dl
rm
versioned.py
11765
0644
edit
dl
rm
win32util.py
9107
0644
edit
dl
rm
wire.py
2830
0644
edit
dl
rm
xfr.py
13273
0644
edit
dl
rm
zone.py
52086
0644
edit
dl
rm
zonefile.py
27929
0644
edit
dl
rm
zonetypes.py
690
0644
edit
dl
rm
_asyncbackend.py
2360
0644
edit
dl
rm
_asyncio_backend.py
8971
0644
edit
dl
rm
_ddr.py
5247
0644
edit
dl
rm
_features.py
2384
0644
edit
dl
rm
_immutable_ctx.py
2459
0644
edit
dl
rm
__init__.py
1663
0644
edit
dl
rm
Edit:
/usr/lib/python3.9/site-packages/dns/_immutable_ctx.py
(2459B)
# Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license # This implementation of the immutable decorator requires python >= # 3.7, and is significantly more storage efficient when making classes # with slots immutable. It's also faster. import contextvars import inspect _in__init__ = contextvars.ContextVar("_immutable_in__init__", default=False) class _Immutable: """Immutable mixin class""" # We set slots to the empty list to say "we don't have any attributes". # We do this so that if we're mixed in with a class with __slots__, we # don't cause a __dict__ to be added which would waste space. __slots__ = () def __setattr__(self, name, value): if _in__init__.get() is not self: raise TypeError("object doesn't support attribute assignment") else: super().__setattr__(name, value) def __delattr__(self, name): if _in__init__.get() is not self: raise TypeError("object doesn't support attribute assignment") else: super().__delattr__(name) def _immutable_init(f): def nf(*args, **kwargs): previous = _in__init__.set(args[0]) try: # call the actual __init__ f(*args, **kwargs) finally: _in__init__.reset(previous) nf.__signature__ = inspect.signature(f) return nf def immutable(cls): if _Immutable in cls.__mro__: # Some ancestor already has the mixin, so just make sure we keep # following the __init__ protocol. cls.__init__ = _immutable_init(cls.__init__) if hasattr(cls, "__setstate__"): cls.__setstate__ = _immutable_init(cls.__setstate__) ncls = cls else: # Mixin the Immutable class and follow the __init__ protocol. class ncls(_Immutable, cls): # We have to do the __slots__ declaration here too! __slots__ = () @_immutable_init def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) if hasattr(cls, "__setstate__"): @_immutable_init def __setstate__(self, *args, **kwargs): super().__setstate__(*args, **kwargs) # make ncls have the same name and module as cls ncls.__name__ = cls.__name__ ncls.__qualname__ = cls.__qualname__ ncls.__module__ = cls.__module__ return ncls
Save
cmd:
run