MNT: Switch to WeakKeyDict
This commit is contained in:
parent
13c67aff0b
commit
51e06c31a7
@ -34,7 +34,7 @@ itemTypes = [
|
|||||||
|
|
||||||
widgets = []
|
widgets = []
|
||||||
items = []
|
items = []
|
||||||
allWidgets = weakref.WeakSet()
|
allWidgets = weakref.WeakKeyDictionary()
|
||||||
|
|
||||||
|
|
||||||
def crashtest():
|
def crashtest():
|
||||||
@ -99,7 +99,7 @@ def createWidget():
|
|||||||
widget = randItem(widgetTypes)()
|
widget = randItem(widgetTypes)()
|
||||||
widget.setWindowTitle(widget.__class__.__name__)
|
widget.setWindowTitle(widget.__class__.__name__)
|
||||||
widgets.append(widget)
|
widgets.append(widget)
|
||||||
allWidgets.add(widget)
|
allWidgets['widget'] = 1
|
||||||
p(" %s" % widget)
|
p(" %s" % widget)
|
||||||
return widget
|
return widget
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user