Skip to content

Commit 07431b2

Browse files
committed
gui: fix lint
1 parent 9ac2efc commit 07431b2

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

arcade/gui/property.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ def remove(self, callback):
8585
@property
8686
def listeners(self) -> list[tuple[AnyListener, _ListenerType]]:
8787
"""Returns a list of all listeners and type, both weak and strong."""
88+
# todo returning a iterator would be more efficient, but might also break
89+
# improve ~0.01 sec
8890
return list(self._listeners.items())
8991

9092

@@ -292,7 +294,8 @@ class MyObject:
292294
Binding to a method of the Property owner itself can cause a memory leak, because the
293295
owner is strongly referenced. Instead, bind the class method, which will be invoked with
294296
the instance as first parameter. `bind(instance, "property_name", Instance.method)`.
295-
Or use the `weak` parameter to bind the method weakly `bind(instance, "property_name", instance.method, weak=True)`
297+
Or use the `weak` parameter to bind the method weakly
298+
bind(instance, "property_name", instance.method, weak=True)`.
296299
297300
Args:
298301
instance: Instance owning the property

tests/unit/gui/test_property.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ def test_bind_callback_with_star_args():
146146

147147
def test_unbind_function_callback():
148148
called = False
149+
149150
def callback(*args):
150151
nonlocal called
151152
called = True
@@ -158,7 +159,8 @@ def callback(*args):
158159
my_obj.name = "New Name"
159160

160161
assert not called
161-
162+
163+
162164
def test_unbind_method_callback():
163165
observer = Observer()
164166

0 commit comments

Comments
 (0)