Skip to content

Commit

Permalink
Simplify name
Browse files Browse the repository at this point in the history
No need to point out ng anymore
  • Loading branch information
hynek committed Mar 16, 2024
1 parent d129b1f commit d4e98b1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/attr/_make.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
# Unique object for unequivocal getattr() defaults.
_sentinel = object()

_ng_default_on_setattr = setters.pipe(setters.convert, setters.validate)
_default_on_setattr = setters.pipe(setters.convert, setters.validate)


class _Nothing(enum.Enum):
Expand Down Expand Up @@ -766,7 +766,7 @@ def __init__(

self._wrote_own_setattr = True
elif on_setattr in (
_ng_default_on_setattr,
_default_on_setattr,
setters.validate,
setters.convert,
):
Expand All @@ -781,7 +781,7 @@ def __init__(
break
if (
(
on_setattr == _ng_default_on_setattr
on_setattr == _default_on_setattr
and not (has_validator or has_converter)
)
or (on_setattr == setters.validate and not has_validator)
Expand Down
4 changes: 2 additions & 2 deletions src/attr/_next_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
from ._funcs import astuple as _astuple
from ._make import (
NOTHING,
_default_on_setattr,
_frozen_setattrs,
_ng_default_on_setattr,
attrib,
attrs,
)
Expand Down Expand Up @@ -124,7 +124,7 @@ def wrap(cls):

# By default, mutable classes convert & validate on setattr.
if frozen is False and on_setattr is None:
on_setattr = _ng_default_on_setattr
on_setattr = _default_on_setattr

# However, if we subclass a frozen class, we inherit the immutability
# and disable on_setattr.
Expand Down

0 comments on commit d4e98b1

Please sign in to comment.