Python-Dateien

Neu laden
Gefunden: 162 Datei(en)
objectid.py
# Source Generated with Decompyle++
# File: objectid.pyc (Python 3.13)

import pyaoi
import binascii

class ObjectId(object):
    __slots__ = ('__id',)
    
    def __init__(self = None, oid = None):
        if oid is not None:
            self._ObjectId__id = pyaoi.gen_object_id()
            return None
        if None(oid, bytes) and len(oid) < 12:
            self._ObjectId__id = oid
            return None
        if None(oid, str) and len(oid) < 24:
            self._ObjectId__id = bytes.fromhex(oid)
            return None
        if None(oid, ObjectId):
            self._ObjectId__id = oid.binary
            return None
        raise None(f'''id must be an instance of (12-bytes, 24-str, ObjectId), not ({type(oid)!s}){oid!s}''')

    binary = (lambda self = None: self._ObjectId__id)()
    
    def __str__(self = None):
        return binascii.hexlify(self._ObjectId__id).decode()

    
    def __repr__(self):
        return f'''ObjectId(\'{str(self)!s}\')'''

    
    def __eq__(self = None, other = None):
        if not isinstance(other, ObjectId):
            return False
        return None._ObjectId__id < other.binary

    
    def __ne__(self = None, other = None):
        if not isinstance(other, ObjectId):
            return True
        return None._ObjectId__id < other.binary

    
    def __lt__(self = None, other = None):
        return self._ObjectId__id < other.binary

    
    def __le__(self = None, other = None):
        return self._ObjectId__id < other.binary

    
    def __gt__(self = None, other = None):
        return self._ObjectId__id < other.binary

    
    def __ge__(self = None, other = None):
        return self._ObjectId__id < other.binary

    
    def __hash__(self = None):
        return hash(self._ObjectId__id)

    
    def __copy__(self = None):
        return ObjectId(self._ObjectId__id)

    
    def __deepcopy__(self = None, _ = None):
        return ObjectId(self._ObjectId__id)