File tree Expand file tree Collapse file tree 3 files changed +4
-24
lines changed Expand file tree Collapse file tree 3 files changed +4
-24
lines changed Original file line number Diff line number Diff line change 11from __future__ import annotations
22
33from typing import TYPE_CHECKING , Any
4- from typing_extensions import ClassVar , override
4+ from typing_extensions import override
55
66from .._utils import LazyProxy
77from ._common import MissingDependencyError , format_instructions
1414
1515
1616class NumpyProxy (LazyProxy [Any ]):
17- should_cache : ClassVar [bool ] = True
18-
1917 @override
2018 def __load__ (self ) -> Any :
2119 try :
Original file line number Diff line number Diff line change 11from __future__ import annotations
22
33from typing import TYPE_CHECKING , Any
4- from typing_extensions import ClassVar , override
4+ from typing_extensions import override
55
66from .._utils import LazyProxy
77from ._common import MissingDependencyError , format_instructions
1414
1515
1616class PandasProxy (LazyProxy [Any ]):
17- should_cache : ClassVar [bool ] = True
18-
1917 @override
2018 def __load__ (self ) -> Any :
2119 try :
Original file line number Diff line number Diff line change 22
33from abc import ABC , abstractmethod
44from typing import Generic , TypeVar , Iterable , cast
5- from typing_extensions import ClassVar , override
5+ from typing_extensions import override
66
77T = TypeVar ("T" )
88
@@ -13,11 +13,6 @@ class LazyProxy(Generic[T], ABC):
1313 This includes forwarding attribute access and othe methods.
1414 """
1515
16- should_cache : ClassVar [bool ] = False
17-
18- def __init__ (self ) -> None :
19- self .__proxied : T | None = None
20-
2116 # Note: we have to special case proxies that themselves return proxies
2217 # to support using a proxy as a catch-all for any random access, e.g. `proxy.foo.bar.baz`
2318
@@ -57,18 +52,7 @@ def __class__(self) -> type:
5752 return proxied .__class__
5853
5954 def __get_proxied__ (self ) -> T :
60- if not self .should_cache :
61- return self .__load__ ()
62-
63- proxied = self .__proxied
64- if proxied is not None :
65- return proxied
66-
67- self .__proxied = proxied = self .__load__ ()
68- return proxied
69-
70- def __set_proxied__ (self , value : T ) -> None :
71- self .__proxied = value
55+ return self .__load__ ()
7256
7357 def __as_proxied__ (self ) -> T :
7458 """Helper method that returns the current proxy, typed as the loaded object"""
You can’t perform that action at this time.
0 commit comments