https://github.com/brandon-rhodes/python-jplephem
Raw File
Tip revision: e958b3213eaf096c7ae87b29cdba460bda649f3f authored by Brandon Rhodes on 06 September 2023, 02:06:25 UTC
Disable Python 2.7 in CI to get it running again
Tip revision: e958b32
descriptorlib.py
from functools import update_wrapper

class reify(object):
    """Adapted from Pyramid's `reify()` memoizing decorator."""
    def __init__(self, method):
        self.method = method
        update_wrapper(self, method)

    def __get__(self, instance, objtype=None):
        if instance is None:
            return self
        value = self.method(instance)
        instance.__dict__[self.__name__] = value
        return value
back to top