$47 GRAYBYTE WORDPRESS FILE MANAGER $74

SERVER : premium201.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 172.67.217.254 | ADMIN IP 216.73.216.157
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : mail

/opt/alt/python310/lib64/python3.10/importlib/metadata/__pycache__/

HOME
Current File : /opt/alt/python310/lib64/python3.10/importlib/metadata/__pycache__//_functools.cpython-310.pyc
o

���hO�@s&ddlZddlZddd�Zdd�ZdS)�Ncs(�pt�����fdd�}dd�|_|S)aV
    Wrap lru_cache to support storing the cache data in the object instances.

    Abstracts the common paradigm where the method explicitly saves an
    underscore-prefixed protected property on first call and returns that
    subsequently.

    >>> class MyClass:
    ...     calls = 0
    ...
    ...     @method_cache
    ...     def method(self, value):
    ...         self.calls += 1
    ...         return value

    >>> a = MyClass()
    >>> a.method(3)
    3
    >>> for x in range(75):
    ...     res = a.method(x)
    >>> a.calls
    75

    Note that the apparent behavior will be exactly like that of lru_cache
    except that the cache is stored on each instance, so values in one
    instance will not flush values from another, and when an instance is
    deleted, so are the cached values for that instance.

    >>> b = MyClass()
    >>> for x in range(35):
    ...     res = b.method(x)
    >>> b.calls
    35
    >>> a.method(0)
    0
    >>> a.calls
    75

    Note that if method had been decorated with ``functools.lru_cache()``,
    a.calls would have been 76 (due to the cached value of 0 having been
    flushed by the 'b' instance).

    Clear the cache with ``.cache_clear()``

    >>> a.method.cache_clear()

    Same for a method that hasn't yet been called.

    >>> c = MyClass()
    >>> c.method.cache_clear()

    Another cache wrapper may be supplied:

    >>> cache = functools.lru_cache(maxsize=2)
    >>> MyClass.method2 = method_cache(lambda self: 3, cache_wrapper=cache)
    >>> a = MyClass()
    >>> a.method2()
    3

    Caution - do not subsequently wrap the method with another decorator, such
    as ``@property``, which changes the semantics of the function.

    See also
    http://code.activestate.com/recipes/577452-a-memoize-decorator-for-instance-methods/
    for another implementation and additional justification.
    cs0t��|�}�|�}t|�j|�||i|��S�N)�types�
MethodType�setattr�__name__)�self�args�kwargsZbound_methodZ
cached_method��
cache_wrapper�method��D/opt/alt/python310/lib64/python3.10/importlib/metadata/_functools.py�wrapperKszmethod_cache.<locals>.wrappercSsdSrr
r
r
r
r�<lambda>Sszmethod_cache.<locals>.<lambda>)�	functools�	lru_cache�cache_clear)rrrr
r
r�method_cachesC
rcst����fdd��}|S)z�
    Wrap func so it's not called if its first param is None

    >>> print_text = pass_none(print)
    >>> print_text('text')
    text
    >>> print_text(None)
    cs"|dur�|g|�Ri|��SdSrr
)Zparamrr	��funcr
rrcs�zpass_none.<locals>.wrapper)r�wraps)rrr
rr�	pass_noneYs
rr)rrrrr
r
r
r�<module>s
S


Current_dir [ NOT WRITEABLE ] Document_root [ NOT WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
10 Feb 2026 9.36 AM
root / linksafe
0755
__init__.cpython-310.opt-1.pyc
36.242 KB
9 Jan 2026 2.05 PM
root / linksafe
0644
__init__.cpython-310.opt-2.pyc
26.07 KB
9 Jan 2026 2.06 PM
root / linksafe
0644
__init__.cpython-310.pyc
36.242 KB
9 Jan 2026 2.05 PM
root / linksafe
0644
_adapters.cpython-310.opt-1.pyc
2.305 KB
9 Jan 2026 2.05 PM
root / linksafe
0644
_adapters.cpython-310.opt-2.pyc
2.192 KB
9 Jan 2026 2.06 PM
root / linksafe
0644
_adapters.cpython-310.pyc
2.305 KB
9 Jan 2026 2.05 PM
root / linksafe
0644
_collections.cpython-310.opt-1.pyc
1.499 KB
9 Jan 2026 2.05 PM
root / linksafe
0644
_collections.cpython-310.opt-2.pyc
1.201 KB
9 Jan 2026 2.06 PM
root / linksafe
0644
_collections.cpython-310.pyc
1.499 KB
9 Jan 2026 2.05 PM
root / linksafe
0644
_functools.cpython-310.opt-1.pyc
3.052 KB
9 Jan 2026 2.05 PM
root / linksafe
0644
_functools.cpython-310.opt-2.pyc
1.06 KB
9 Jan 2026 2.06 PM
root / linksafe
0644
_functools.cpython-310.pyc
3.052 KB
9 Jan 2026 2.05 PM
root / linksafe
0644
_itertools.cpython-310.opt-1.pyc
0.573 KB
9 Jan 2026 2.05 PM
root / linksafe
0644
_itertools.cpython-310.opt-2.pyc
0.507 KB
9 Jan 2026 2.06 PM
root / linksafe
0644
_itertools.cpython-310.pyc
0.573 KB
9 Jan 2026 2.05 PM
root / linksafe
0644
_meta.cpython-310.opt-1.pyc
2.227 KB
9 Jan 2026 2.05 PM
root / linksafe
0644
_meta.cpython-310.opt-2.pyc
2.006 KB
9 Jan 2026 2.06 PM
root / linksafe
0644
_meta.cpython-310.pyc
2.227 KB
9 Jan 2026 2.05 PM
root / linksafe
0644
_text.cpython-310.opt-1.pyc
3.004 KB
9 Jan 2026 2.05 PM
root / linksafe
0644
_text.cpython-310.opt-2.pyc
1.848 KB
9 Jan 2026 2.06 PM
root / linksafe
0644
_text.cpython-310.pyc
3.004 KB
9 Jan 2026 2.05 PM
root / linksafe
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025 CONTACT ME
Static GIF