Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Shared.DC.Scripts.Bindings.UnauthorizedBinding.__getattr__" has wrong signature #703

Closed
d-maurer opened this issue Sep 16, 2019 · 1 comment · Fixed by #725

Comments

@d-maurer
Copy link
Contributor

@d-maurer d-maurer commented Sep 16, 2019

The Python documentation specifies:

object.__getattr__(self, name)

Called when an attribute lookup has not found the attribute in the usual places (i.e. it is not an instance attribute nor is it found in the class tree for self). name is the attribute name. This method should return the (computed) attribute value or raise an AttributeError exception.

However, Shared.DC.Scripts.Bindings.UnauthorizedBinding.__getattr__ has the signature self, name, default=None. When Python's getattr(obj, x, default) delegates to this __getattr__ it will not pass on default and the result will be None when obj has not attribute x.

@d-maurer d-maurer added the bug label Sep 16, 2019
@icemac

This comment has been minimized.

Copy link
Member

@icemac icemac commented Sep 17, 2019

A PR to fix this is welcome.

dataflake added a commit that referenced this issue Nov 3, 2019
dataflake added a commit that referenced this issue Nov 4, 2019
… (#725)
dataflake added a commit that referenced this issue Nov 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.