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

Ensure that bare attributes with default None are removed too #556

Merged
merged 3 commits into from
Jul 23, 2019

Conversation

hynek
Copy link
Member

@hynek hynek commented Jul 21, 2019

Fixes #523

Classic None-as-sentinel-where-None-is-a-valid-value-blunder.

@ambv ambv merged commit dc1b5a0 into master Jul 23, 2019
@hynek hynek deleted the none-attribs branch July 23, 2019 11:19
@@ -504,7 +507,7 @@ def _patch_original_class(self):
for name in self._attr_names:
if (
name not in base_names
and getattr(cls, name, None) is not None
and getattr(cls, name, _sentinel) != _sentinel

Choose a reason for hiding this comment

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

this should use is not

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.

Attrs deletes any non-None class attributes
3 participants