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

Avoid using built-in vars() which fails on objects without dict #7

Merged
merged 1 commit into from
May 21, 2023

Conversation

Tronic
Copy link
Member

@Tronic Tronic commented May 16, 2023

Better handling of objects using __slots__.

Fix #6

Copy link
Member

@ahopkins ahopkins left a comment

Choose a reason for hiding this comment

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

Looks simple and straight-forward enough. Two points--and they are larger project-wide items for consideration:

  1. No testing.
  2. I would consider making it _safe_vars since it is not an API intended for public consumption.

@Tronic Tronic merged commit 1e514e5 into main May 21, 2023
@Tronic
Copy link
Member Author

Tronic commented May 21, 2023

@ahopkins Not likely I'll have time to implement tests. Public APIs are imported in __init__.py and the submodules don't use that underscore convention for their helper functions (such as prettyvalue in that same module).

@ahopkins
Copy link
Member

@ahopkins Not likely I'll have time to implement tests. Public APIs are imported in __init__.py and the submodules don't use that underscore convention for their helper functions (such as prettyvalue in that same module).

I didn't think you would get tests started for this PR, but something we should consider in future.

@Tronic Tronic deleted the inspector-vars branch May 21, 2023 23:03
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.

TypeError: vars() argument must have __dict__ attribute
2 participants