/opt/alt/python311/lib64/python3.11
NameSizeModeActions
asyncio/-0755rm
collections/-0755rm
concurrent/-0755rm
config-3.11-x86_64-linux-gnu/-0755rm
ctypes/-0755rm
curses/-0755rm
dbm/-0755rm
distutils/-0755rm
email/-0755rm
encodings/-0755rm
ensurepip/-0755rm
html/-0755rm
http/-0755rm
importlib/-0755rm
json/-0755rm
lib-dynload/-0755rm
lib2to3/-0755rm
logging/-0755rm
multiprocessing/-0755rm
pydoc_data/-0755rm
re/-0755rm
site-packages/-0755rm
sqlite3/-0755rm
tomllib/-0755rm
unittest/-0755rm
urllib/-0755rm
venv/-0755rm
wsgiref/-0755rm
xml/-0755rm
xmlrpc/-0755rm
zoneinfo/-0755rm
__phello__/-0755rm
__pycache__/-0755rm
abc.py65380644editdlrm
aifc.py342110644editdlrm
antigravity.py5000644editdlrm
argparse.py1002830644editdlrm
ast.py614440644editdlrm
asynchat.py115700644editdlrm
asyncore.py203100644editdlrm
base64.py210410755editdlrm
bdb.py324630644editdlrm
bisect.py31350644editdlrm
bz2.py118470644editdlrm
calendar.py247310644editdlrm
cgi.py344320755editdlrm
cgitb.py124210644editdlrm
chunk.py55000644editdlrm
cmd.py148730644editdlrm
code.py106220644editdlrm
codecs.py371500644editdlrm
codeop.py59070644editdlrm
colorsys.py40620644editdlrm
compileall.py202520644editdlrm
configparser.py556600644editdlrm
contextlib.py274140644editdlrm
contextvars.py1290644editdlrm
copy.py86810644editdlrm
copyreg.py76770644editdlrm
cProfile.py63590755editdlrm
crypt.py39130644editdlrm
csv.py160300644editdlrm
dataclasses.py584720644editdlrm
datetime.py918320644editdlrm
decimal.py3200644editdlrm
difflib.py833080644editdlrm
dis.py289060644editdlrm
doctest.py1062970644editdlrm
enum.py795830644editdlrm
filecmp.py101780644editdlrm
fileinput.py157140644editdlrm
fnmatch.py59990644editdlrm
fractions.py286770644editdlrm
ftplib.py358150644editdlrm
functools.py384130644editdlrm
genericpath.py49750644editdlrm
getopt.py74890644editdlrm
getpass.py59900644editdlrm
gettext.py213200644editdlrm
glob.py87320644editdlrm
graphlib.py96560644editdlrm
gzip.py240740644editdlrm
hashlib.py117650644editdlrm
heapq.py230240644editdlrm
hmac.py77160644editdlrm
imaplib.py552170644editdlrm
imghdr.py39520644editdlrm
imp.py106060644editdlrm
inspect.py1234190644editdlrm
io.py43200644editdlrm
ipaddress.py791240644editdlrm
keyword.py10610644editdlrm
LICENSE.txt139360644editdlrm
linecache.py56490644editdlrm
locale.py790950644editdlrm
lzma.py132770644editdlrm
mailbox.py788300644editdlrm
mailcap.py93690644editdlrm
mimetypes.py229620644editdlrm
modulefinder.py236990644editdlrm
netrc.py69290644editdlrm
nntplib.py410870644editdlrm
ntpath.py302220644editdlrm
nturl2path.py28870644editdlrm
numbers.py103480644editdlrm
opcode.py104470644editdlrm
operator.py109650644editdlrm
optparse.py603690644editdlrm
os.py395300644editdlrm
pathlib.py485660644editdlrm
pdb.py641860755editdlrm
pickle.py651320644editdlrm
pickletools.py938610644editdlrm
pipes.py89780644editdlrm
pkgutil.py246380644editdlrm
platform.py422870755editdlrm
plistlib.py283540644editdlrm
poplib.py151980644editdlrm
posixpath.py170130644editdlrm
pprint.py245830644editdlrm
profile.py228960755editdlrm
pstats.py293560644editdlrm
pty.py63170644editdlrm
pyclbr.py113960644editdlrm
pydoc.py1126640755editdlrm
py_compile.py78370644editdlrm
queue.py114960644editdlrm
quopri.py72810755editdlrm
random.py321620644editdlrm
reprlib.py54370644editdlrm
rlcompleter.py78270644editdlrm
runpy.py131590644editdlrm
sched.py63510644editdlrm
secrets.py20280644editdlrm
selectors.py196710644editdlrm
shelve.py85600644editdlrm
shlex.py135010644editdlrm
shutil.py565170644editdlrm
signal.py24950644editdlrm
site.py229870644editdlrm
smtpd.py311750755editdlrm
smtplib.py454310755editdlrm
sndhdr.py74480644editdlrm
socket.py375570644editdlrm
socketserver.py275860644editdlrm
sre_compile.py2310644editdlrm
sre_constants.py2320644editdlrm
sre_parse.py2290644editdlrm
ssl.py543050644editdlrm
stat.py54850644editdlrm
statistics.py477050644editdlrm
string.py117860644editdlrm
stringprep.py129170644editdlrm
struct.py2570644editdlrm
subprocess.py887250644editdlrm
sunau.py184800644editdlrm
symtable.py103680644editdlrm
sysconfig.py303150644editdlrm
tabnanny.py113120755editdlrm
tarfile.py1078760755editdlrm
telnetlib.py233010644editdlrm
tempfile.py318730644editdlrm
textwrap.py197180644editdlrm
this.py10030644editdlrm
threading.py582310644editdlrm
timeit.py135320755editdlrm
token.py23860644editdlrm
tokenize.py263360644editdlrm
trace.py291960755editdlrm
traceback.py405470644editdlrm
tracemalloc.py180470644editdlrm
tty.py8790644editdlrm
types.py100670644editdlrm
typing.py1209510644editdlrm
uu.py73410644editdlrm
uuid.py275970644editdlrm
warnings.py211100644editdlrm
wave.py218180644editdlrm
weakref.py215130644editdlrm
webbrowser.py251490755editdlrm
xdrlib.py59770644editdlrm
zipapp.py75350644editdlrm
zipfile.py937880644editdlrm
zipimport.py308970644editdlrm
_aix_support.py33890644editdlrm
_bootsubprocess.py26750644editdlrm
_collections_abc.py301930644editdlrm
_compat_pickle.py87610644editdlrm
_compression.py56810644editdlrm
_markupbase.py146530644editdlrm
_osx_support.py220230644editdlrm
_pydecimal.py2292020644editdlrm
_pyio.py941930644editdlrm
_py_abc.py61890644editdlrm
_sitebuiltins.py31280644editdlrm
_strptime.py251750644editdlrm
_sysconfigdata_d_linux_x86_64-linux-gnu.py588780644editdlrm
_sysconfigdata__linux_x86_64-linux-gnu.py596450644editdlrm
_threading_local.py72200644editdlrm
_weakrefset.py58930644editdlrm
__future__.py52180644editdlrm
__hello__.py2270644editdlrm
Edit: /opt/alt/python311/lib64/python3.11/copyreg.py (7677B)
"""Helper to provide extensibility for pickle. This is only useful to add pickle support for extension types defined in C, not for instances of user-defined classes. """ __all__ = ["pickle", "constructor", "add_extension", "remove_extension", "clear_extension_cache"] dispatch_table = {} def pickle(ob_type, pickle_function, constructor_ob=None): if not callable(pickle_function): raise TypeError("reduction functions must be callable") dispatch_table[ob_type] = pickle_function # The constructor_ob function is a vestige of safe for unpickling. # There is no reason for the caller to pass it anymore. if constructor_ob is not None: constructor(constructor_ob) def constructor(object): if not callable(object): raise TypeError("constructors must be callable") # Example: provide pickling support for complex numbers. try: complex except NameError: pass else: def pickle_complex(c): return complex, (c.real, c.imag) pickle(complex, pickle_complex, complex) def pickle_union(obj): import functools, operator return functools.reduce, (operator.or_, obj.__args__) pickle(type(int | str), pickle_union) # Support for pickling new-style objects def _reconstructor(cls, base, state): if base is object: obj = object.__new__(cls) else: obj = base.__new__(cls, state) if base.__init__ != object.__init__: base.__init__(obj, state) return obj _HEAPTYPE = 1<<9 _new_type = type(int.__new__) # Python code for object.__reduce_ex__ for protocols 0 and 1 def _reduce_ex(self, proto): assert proto < 2 cls = self.__class__ for base in cls.__mro__: if hasattr(base, '__flags__') and not base.__flags__ & _HEAPTYPE: break new = base.__new__ if isinstance(new, _new_type) and new.__self__ is base: break else: base = object # not really reachable if base is object: state = None else: if base is cls: raise TypeError(f"cannot pickle {cls.__name__!r} object") state = base(self) args = (cls, base, state) try: getstate = self.__getstate__ except AttributeError: if getattr(self, "__slots__", None): raise TypeError(f"cannot pickle {cls.__name__!r} object: " f"a class that defines __slots__ without " f"defining __getstate__ cannot be pickled " f"with protocol {proto}") from None try: dict = self.__dict__ except AttributeError: dict = None else: if (type(self).__getstate__ is object.__getstate__ and getattr(self, "__slots__", None)): raise TypeError("a class that defines __slots__ without " "defining __getstate__ cannot be pickled") dict = getstate() if dict: return _reconstructor, args, dict else: return _reconstructor, args # Helper for __reduce_ex__ protocol 2 def __newobj__(cls, *args): return cls.__new__(cls, *args) def __newobj_ex__(cls, args, kwargs): """Used by pickle protocol 4, instead of __newobj__ to allow classes with keyword-only arguments to be pickled correctly. """ return cls.__new__(cls, *args, **kwargs) def _slotnames(cls): """Return a list of slot names for a given class. This needs to find slots defined by the class and its bases, so we can't simply return the __slots__ attribute. We must walk down the Method Resolution Order and concatenate the __slots__ of each class found there. (This assumes classes don't modify their __slots__ attribute to misrepresent their slots after the class is defined.) """ # Get the value from a cache in the class if possible names = cls.__dict__.get("__slotnames__") if names is not None: return names # Not cached -- calculate the value names = [] if not hasattr(cls, "__slots__"): # This class has no slots pass else: # Slots found -- gather slot names from all base classes for c in cls.__mro__: if "__slots__" in c.__dict__: slots = c.__dict__['__slots__'] # if class has a single slot, it can be given as a string if isinstance(slots, str): slots = (slots,) for name in slots: # special descriptors if name in ("__dict__", "__weakref__"): continue # mangled names elif name.startswith('__') and not name.endswith('__'): stripped = c.__name__.lstrip('_') if stripped: names.append('_%s%s' % (stripped, name)) else: names.append(name) else: names.append(name) # Cache the outcome in the class if at all possible try: cls.__slotnames__ = names except: pass # But don't die if we can't return names # A registry of extension codes. This is an ad-hoc compression # mechanism. Whenever a global reference to , is about # to be pickled, the (, ) tuple is looked up here to see # if it is a registered extension code for it. Extension codes are # universal, so that the meaning of a pickle does not depend on # context. (There are also some codes reserved for local use that # don't have this restriction.) Codes are positive ints; 0 is # reserved. _extension_registry = {} # key -> code _inverted_registry = {} # code -> key _extension_cache = {} # code -> object # Don't ever rebind those names: pickling grabs a reference to them when # it's initialized, and won't see a rebinding. def add_extension(module, name, code): """Register an extension code.""" code = int(code) if not 1 <= code <= 0x7fffffff: raise ValueError("code out of range") key = (module, name) if (_extension_registry.get(key) == code and _inverted_registry.get(code) == key): return # Redundant registrations are benign if key in _extension_registry: raise ValueError("key %s is already registered with code %s" % (key, _extension_registry[key])) if code in _inverted_registry: raise ValueError("code %s is already in use for key %s" % (code, _inverted_registry[code])) _extension_registry[key] = code _inverted_registry[code] = key def remove_extension(module, name, code): """Unregister an extension code. For testing only.""" key = (module, name) if (_extension_registry.get(key) != code or _inverted_registry.get(code) != key): raise ValueError("key %s is not registered with code %s" % (key, code)) del _extension_registry[key] del _inverted_registry[code] if code in _extension_cache: del _extension_cache[code] def clear_extension_cache(): _extension_cache.clear() # Standard extension code assignments # Reserved ranges # First Last Count Purpose # 1 127 127 Reserved for Python standard library # 128 191 64 Reserved for Zope # 192 239 48 Reserved for 3rd parties # 240 255 16 Reserved for private use (will never be assigned) # 256 Inf Inf Reserved for future assignment # Extension codes are assigned by the Python Software Foundation.