-
-
Notifications
You must be signed in to change notification settings - Fork 409
Closed
Labels
BugThings to squish; generally used for issuesThings to squish; generally used for issuesMedium Priority
Milestone
Description
Description
SopelIdentifierMemory automatically casts strings to Identifiers when accessing contents with mem["foo"], but pop() doesn't seem to.
Reproduction steps
>>> from sopel.tools import Identifier, SopelIdentifierMemory
>>> mem = SopelIdentifierMemory()
>>> mem["Foo"] = "bar"
>>> mem["Foo"]
'bar'
>>> mem.pop("Foo")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
KeyError: 'Foo'
>>> mem.pop(Identifier("Foo"))
'bar'Note the capital F in "Foo" - hashing Identifier("foo") and "foo" seems to match, but not Identifier("Foo") and "Foo".
Expected behavior
pop() performs the same cast as mem["Foo"] and works.
Sopel version
Installation method
pip install
Python version
3.11.5
dgwdgw
Metadata
Metadata
Assignees
Labels
BugThings to squish; generally used for issuesThings to squish; generally used for issuesMedium Priority