Skip to content

fix: correct the Model.get_binding() return type#2329

Merged
tonyandrewmeyer merged 3 commits intocanonical:mainfrom
tonyandrewmeyer:fix-get-binding-return-type
Feb 17, 2026
Merged

fix: correct the Model.get_binding() return type#2329
tonyandrewmeyer merged 3 commits intocanonical:mainfrom
tonyandrewmeyer:fix-get-binding-return-type

Conversation

@tonyandrewmeyer
Copy link
Copy Markdown
Collaborator

Although the ._bindings attribute is a mapping, and we are using get(), the implementation never returns None, it always creates a new Binding if there isn't one. The signature for get() is correct and does not include None as a possible return type. This PR extends that to the get_binding() method.

Issue reported by @Gu1nness on Matrix.

Copy link
Copy Markdown
Contributor

@james-garner-canonical james-garner-canonical left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice find, @Gu1nness

@tonyandrewmeyer tonyandrewmeyer merged commit 3df8ae9 into canonical:main Feb 17, 2026
59 checks passed
@tonyandrewmeyer tonyandrewmeyer deleted the fix-get-binding-return-type branch February 17, 2026 06:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants