Skip to content

Commit

Permalink
slots-ify internal classes
Browse files Browse the repository at this point in the history
Saves memory without downsides.

Ref #60
  • Loading branch information
hynek committed Aug 17, 2016
1 parent 8ad7602 commit ab9cbc8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/attr/_make.py
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ def __init__(self, default, validator, repr, cmp, hash, init, convert):
_CountingAttr = _add_cmp(_add_repr(_CountingAttr))


@attributes
@attributes(slots=True)
class Factory(object):
"""
Stores a factory callable.
Expand Down
6 changes: 3 additions & 3 deletions src/attr/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from ._make import attr, attributes


@attributes(repr=False)
@attributes(repr=False, slots=True)
class _InstanceOfValidator(object):
type = attr()

Expand Down Expand Up @@ -47,7 +47,7 @@ def instance_of(type):
return _InstanceOfValidator(type)


@attributes(repr=False)
@attributes(repr=False, slots=True)
class _ProvidesValidator(object):
interface = attr()

Expand Down Expand Up @@ -87,7 +87,7 @@ def provides(interface):
return _ProvidesValidator(interface)


@attributes(repr=False)
@attributes(repr=False, slots=True)
class _OptionalValidator(object):
validator = attr()

Expand Down

0 comments on commit ab9cbc8

Please sign in to comment.