Skip to content

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

Merged
ambv merged 3 commits intomasterfrom
none-attribs
Jul 23, 2019
Merged

Ensure that bare attributes with default None are removed too#556
ambv merged 3 commits intomasterfrom
none-attribs

Conversation

@hynek
Copy link
Copy Markdown
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
Comment thread src/attr/_make.py
if (
name not in base_names
and getattr(cls, name, None) is not None
and getattr(cls, name, _sentinel) != _sentinel
Copy link
Copy Markdown

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