Use update_wrapper in lazy_property update attribute info

This commit is contained in:
Kristóf Tóth 2018-06-05 00:15:43 +02:00
parent ab966f6d27
commit 2e3b49f8b5

View File

@ -1,6 +1,8 @@
# Copyright (C) 2018 Avatao.com Innovative Learning Kft. # Copyright (C) 2018 Avatao.com Innovative Learning Kft.
# All Rights Reserved. See LICENSE file for details. # All Rights Reserved. See LICENSE file for details.
from functools import update_wrapper
class lazy_property: class lazy_property:
""" """
@ -9,7 +11,7 @@ class lazy_property:
""" """
def __init__(self, func): def __init__(self, func):
self.func = func self.func = func
self.__doc__ = func.__doc__ update_wrapper(self, func)
def __get__(self, instance, owner): def __get__(self, instance, owner):
if instance is None: if instance is None: