File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,11 @@ class config:
10
10
# }
11
11
_config_paths : list = None
12
12
13
- def __init__ (self ,path :str | list | None = None ) -> None :
13
+ def __init__ (self ,path = None ) -> None :
14
+ """
15
+ path should be list|str
16
+
17
+ """
14
18
self .path = path
15
19
16
20
@property
@@ -19,14 +23,15 @@ def path(self):
19
23
return self ._config_paths
20
24
21
25
@path .setter
22
- def path (self ,path : str | list | None = None ):
26
+ def path (self ,path = None ):
23
27
if path is None :
24
28
self ._config_paths = []
25
- if isinstance (path ,str ):
29
+ elif isinstance (path ,str ):
26
30
self ._config_paths = [path ]
27
- if isinstance (path ,list ):
31
+ elif isinstance (path ,list ):
28
32
self ._config_paths = path
29
-
33
+ else :
34
+ raise ValueError ('path should be list|str' )
30
35
class DictClass (object ):
31
36
"create a class from dict"
32
37
def __init__ (self , ** kwargs ):
You can’t perform that action at this time.
0 commit comments