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

Add 3rd argument to getattr #727

Open
wants to merge 1 commit into
base: dev_fall_2019
Choose a base branch
from

Conversation

AlexECX
Copy link

@AlexECX AlexECX commented May 14, 2020

Change Summary

The getattr function is missing the optional 3rd, 'failsafe', argument, it also does not raise an AttributeError when the accessed attribute is not present. This PR takes care of both issues.

Note: The proposed new getattr function takes extra steps to retrieve the name of the accessed object when building the AttributeError message. A more generic message could be used instead, although it would make it less meaningful.

Related issue number

Related to #633 .

PR Checklist

  • Adapted tests
  • Passes tests
  • Documented changes
  • Compatibility with primitives

@AlexECX AlexECX force-pushed the Add-3rd-argument-to-getattr branch from 39c739e to add814a Compare May 14, 2020 18:57
@AlexECX AlexECX force-pushed the Add-3rd-argument-to-getattr branch from add814a to f2c6a60 Compare May 14, 2020 19:00
@AlexECX AlexECX changed the base branch from master to dev_fall_2019 May 14, 2020 19:01
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.

1 participant