Skip to content

Commit 8fd47e7

Browse files
authored
feat: rollback isinstance (#310)
1 parent a519a8b commit 8fd47e7

File tree

48 files changed

+1378
-1394
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1378
-1394
lines changed

scaleway-async/scaleway_async/applesilicon/v1alpha1/marshalling.py

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121

2222

2323
def unmarshal_ServerTypeCPU(data: Any) -> ServerTypeCPU:
24-
if not isinstance(data, dict):
24+
if type(data) is not dict:
2525
raise TypeError(
26-
"Unmarshalling the type 'ServerTypeCPU' failed as data isn't a dictionary."
26+
f"Unmarshalling the type 'ServerTypeCPU' failed as data isn't a dictionary."
2727
)
2828

2929
args: Dict[str, Any] = {}
@@ -38,9 +38,9 @@ def unmarshal_ServerTypeCPU(data: Any) -> ServerTypeCPU:
3838

3939

4040
def unmarshal_ServerTypeDisk(data: Any) -> ServerTypeDisk:
41-
if not isinstance(data, dict):
41+
if type(data) is not dict:
4242
raise TypeError(
43-
"Unmarshalling the type 'ServerTypeDisk' failed as data isn't a dictionary."
43+
f"Unmarshalling the type 'ServerTypeDisk' failed as data isn't a dictionary."
4444
)
4545

4646
args: Dict[str, Any] = {}
@@ -55,9 +55,9 @@ def unmarshal_ServerTypeDisk(data: Any) -> ServerTypeDisk:
5555

5656

5757
def unmarshal_ServerTypeMemory(data: Any) -> ServerTypeMemory:
58-
if not isinstance(data, dict):
58+
if type(data) is not dict:
5959
raise TypeError(
60-
"Unmarshalling the type 'ServerTypeMemory' failed as data isn't a dictionary."
60+
f"Unmarshalling the type 'ServerTypeMemory' failed as data isn't a dictionary."
6161
)
6262

6363
args: Dict[str, Any] = {}
@@ -72,9 +72,9 @@ def unmarshal_ServerTypeMemory(data: Any) -> ServerTypeMemory:
7272

7373

7474
def unmarshal_OS(data: Any) -> OS:
75-
if not isinstance(data, dict):
75+
if type(data) is not dict:
7676
raise TypeError(
77-
"Unmarshalling the type 'OS' failed as data isn't a dictionary."
77+
f"Unmarshalling the type 'OS' failed as data isn't a dictionary."
7878
)
7979

8080
args: Dict[str, Any] = {}
@@ -98,18 +98,18 @@ def unmarshal_OS(data: Any) -> OS:
9898

9999

100100
def unmarshal_Server(data: Any) -> Server:
101-
if not isinstance(data, dict):
101+
if type(data) is not dict:
102102
raise TypeError(
103-
"Unmarshalling the type 'Server' failed as data isn't a dictionary."
103+
f"Unmarshalling the type 'Server' failed as data isn't a dictionary."
104104
)
105105

106106
args: Dict[str, Any] = {}
107107

108108
field = data.get("created_at", None)
109-
args["created_at"] = parser.isoparse(field) if isinstance(field, str) else field
109+
args["created_at"] = parser.isoparse(field) if type(field) is str else field
110110

111111
field = data.get("deletable_at", None)
112-
args["deletable_at"] = parser.isoparse(field) if isinstance(field, str) else field
112+
args["deletable_at"] = parser.isoparse(field) if type(field) is str else field
113113

114114
field = data.get("id", None)
115115
args["id"] = field
@@ -133,7 +133,7 @@ def unmarshal_Server(data: Any) -> Server:
133133
args["type_"] = field
134134

135135
field = data.get("updated_at", None)
136-
args["updated_at"] = parser.isoparse(field) if isinstance(field, str) else field
136+
args["updated_at"] = parser.isoparse(field) if type(field) is str else field
137137

138138
field = data.get("vnc_url", None)
139139
args["vnc_url"] = field
@@ -145,9 +145,9 @@ def unmarshal_Server(data: Any) -> Server:
145145

146146

147147
def unmarshal_ServerType(data: Any) -> ServerType:
148-
if not isinstance(data, dict):
148+
if type(data) is not dict:
149149
raise TypeError(
150-
"Unmarshalling the type 'ServerType' failed as data isn't a dictionary."
150+
f"Unmarshalling the type 'ServerType' failed as data isn't a dictionary."
151151
)
152152

153153
args: Dict[str, Any] = {}
@@ -174,9 +174,9 @@ def unmarshal_ServerType(data: Any) -> ServerType:
174174

175175

176176
def unmarshal_ListOSResponse(data: Any) -> ListOSResponse:
177-
if not isinstance(data, dict):
177+
if type(data) is not dict:
178178
raise TypeError(
179-
"Unmarshalling the type 'ListOSResponse' failed as data isn't a dictionary."
179+
f"Unmarshalling the type 'ListOSResponse' failed as data isn't a dictionary."
180180
)
181181

182182
args: Dict[str, Any] = {}
@@ -191,9 +191,9 @@ def unmarshal_ListOSResponse(data: Any) -> ListOSResponse:
191191

192192

193193
def unmarshal_ListServerTypesResponse(data: Any) -> ListServerTypesResponse:
194-
if not isinstance(data, dict):
194+
if type(data) is not dict:
195195
raise TypeError(
196-
"Unmarshalling the type 'ListServerTypesResponse' failed as data isn't a dictionary."
196+
f"Unmarshalling the type 'ListServerTypesResponse' failed as data isn't a dictionary."
197197
)
198198

199199
args: Dict[str, Any] = {}
@@ -207,9 +207,9 @@ def unmarshal_ListServerTypesResponse(data: Any) -> ListServerTypesResponse:
207207

208208

209209
def unmarshal_ListServersResponse(data: Any) -> ListServersResponse:
210-
if not isinstance(data, dict):
210+
if type(data) is not dict:
211211
raise TypeError(
212-
"Unmarshalling the type 'ListServersResponse' failed as data isn't a dictionary."
212+
f"Unmarshalling the type 'ListServersResponse' failed as data isn't a dictionary."
213213
)
214214

215215
args: Dict[str, Any] = {}

0 commit comments

Comments
 (0)