mirror of
				https://github.com/avatao-content/baseimage-tutorial-framework
				synced 2025-11-04 06:32:55 +00:00 
			
		
		
		
	Use update_wrapper in lazy_property update attribute info
This commit is contained in:
		@@ -1,6 +1,8 @@
 | 
			
		||||
# Copyright (C) 2018 Avatao.com Innovative Learning Kft.
 | 
			
		||||
# All Rights Reserved. See LICENSE file for details.
 | 
			
		||||
 | 
			
		||||
from functools import update_wrapper
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class lazy_property:
 | 
			
		||||
    """
 | 
			
		||||
@@ -9,7 +11,7 @@ class lazy_property:
 | 
			
		||||
    """
 | 
			
		||||
    def __init__(self, func):
 | 
			
		||||
        self.func = func
 | 
			
		||||
        self.__doc__ = func.__doc__
 | 
			
		||||
        update_wrapper(self, func)
 | 
			
		||||
 | 
			
		||||
    def __get__(self, instance, owner):
 | 
			
		||||
        if instance is None:
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user