Skip to content

Commit 413f418

Browse files
Fix linter warnings
Signed-off-by: Jean-Christophe Morin <[email protected]>
1 parent cf764ee commit 413f418

File tree

2 files changed

+24
-24
lines changed

2 files changed

+24
-24
lines changed

src/py-opentimelineio/opentimelineio/core/_core_utils.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ def __copy__(self, *args, **kwargs):
397397

398398

399399
@add_method(AnyDictionary)
400-
def to_dict(self):
400+
def to_dict(self): # noqa: F811
401401
"""
402402
Convert to a built-in dict. It will recursively convert all values
403403
to their corresponding python built-in types.
@@ -415,7 +415,7 @@ def to_list(self):
415415

416416

417417
@add_method(SerializableObject)
418-
def to_dict(self):
418+
def to_dict(self): # noqa: F811
419419
"""
420420
Convert to a built-in dict. It will recursively convert all values
421421
to their corresponding python built-in types.
@@ -424,7 +424,7 @@ def to_dict(self):
424424

425425

426426
@add_method(RationalTime)
427-
def to_dict(self):
427+
def to_dict(self): # noqa: F811
428428
"""
429429
Convert to a built-in dict. It will recursively convert all values
430430
to their corresponding python built-in types.
@@ -433,7 +433,7 @@ def to_dict(self):
433433

434434

435435
@add_method(TimeRange)
436-
def to_dict(self):
436+
def to_dict(self): # noqa: F811
437437
"""
438438
Convert to a built-in dict. It will recursively convert all values
439439
to their corresponding python built-in types.
@@ -442,7 +442,7 @@ def to_dict(self):
442442

443443

444444
@add_method(TimeTransform)
445-
def to_dict(self):
445+
def to_dict(self): # noqa: F811
446446
"""
447447
Convert to a built-in dict. It will recursively convert all values
448448
to their corresponding python built-in types.

tests/test_core_utils.py

+19-19
Original file line numberDiff line numberDiff line change
@@ -252,45 +252,45 @@ def test_SerializableObject(self):
252252
so = opentimelineio.core.SerializableObjectWithMetadata(name="asd")
253253
so.metadata["key1"] = opentimelineio.core.Composition()
254254

255-
d = so.to_dict()
256-
self.assertTrue(isinstance(d, dict))
257-
json.dumps(d)
255+
converted = so.to_dict()
256+
self.assertTrue(isinstance(converted, dict))
257+
json.dumps(converted)
258258

259259
def test_AnyDictionary(self):
260260
ad = opentimelineio._otio.AnyDictionary()
261261
ad["my key"] = opentimelineio.core.Composable()
262262

263-
d = ad.to_dict()
264-
self.assertTrue(isinstance(d, dict))
265-
json.dumps(d)
263+
converted = ad.to_dict()
264+
self.assertTrue(isinstance(converted, dict))
265+
json.dumps(converted)
266266

267267
def test_AnyVector(self):
268268
av = opentimelineio._otio.AnyVector()
269269
av.append(1)
270270
av.append(opentimelineio._otio.AnyDictionary())
271271

272-
l = av.to_list()
273-
self.assertTrue(isinstance(l, list))
274-
self.assertEqual(l, [1, {}])
275-
json.dumps(l)
272+
converted = av.to_list()
273+
self.assertTrue(isinstance(converted, list))
274+
self.assertEqual(converted, [1, {}])
275+
json.dumps(converted)
276276

277277
def test_RationalTime(self):
278278
rt = opentimelineio.opentime.RationalTime()
279279

280-
d = rt.to_dict()
281-
self.assertTrue(isinstance(d, dict))
282-
json.dumps(d)
280+
converted = rt.to_dict()
281+
self.assertTrue(isinstance(converted, dict))
282+
json.dumps(converted)
283283

284284
def test_TimeRange(self):
285285
tr = opentimelineio.opentime.TimeRange()
286286

287-
d = tr.to_dict()
288-
self.assertTrue(isinstance(d, dict))
289-
json.dumps(d)
287+
converted = tr.to_dict()
288+
self.assertTrue(isinstance(converted, dict))
289+
json.dumps(converted)
290290

291291
def test_TimeTransform(self):
292292
tt = opentimelineio.opentime.TimeTransform()
293293

294-
d = tt.to_dict()
295-
self.assertTrue(isinstance(d, dict))
296-
json.dumps(d)
294+
converted = tt.to_dict()
295+
self.assertTrue(isinstance(converted, dict))
296+
json.dumps(converted)

0 commit comments

Comments
 (0)