mirror of
https://github.com/django/django.git
synced 2025-01-03 15:06:09 +00:00
Removed unnecessary wrapping of __bytes__ in proxy class in lazy().
This commit is contained in:
parent
c7ba2e3cbb
commit
459f30f73e
@ -126,8 +126,6 @@ def lazy(func, *resultclasses):
|
|||||||
"Cannot call lazy() with both bytes and text return types."
|
"Cannot call lazy() with both bytes and text return types."
|
||||||
)
|
)
|
||||||
|
|
||||||
if cls._delegate_bytes:
|
|
||||||
cls.__bytes__ = cls.__bytes_cast
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def __promise__(cls, method_name):
|
def __promise__(cls, method_name):
|
||||||
@ -140,9 +138,6 @@ def lazy(func, *resultclasses):
|
|||||||
|
|
||||||
return __wrapper__
|
return __wrapper__
|
||||||
|
|
||||||
def __bytes_cast(self):
|
|
||||||
return bytes(func(*self.__args, **self.__kw))
|
|
||||||
|
|
||||||
def __cast(self):
|
def __cast(self):
|
||||||
return func(*self.__args, **self.__kw)
|
return func(*self.__args, **self.__kw)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user