slots-ify internal classes

Saves memory without downsides.

Ref #60
This commit is contained in:
Hynek Schlawack 2016-08-17 14:26:32 +02:00
parent 8ad7602992
commit ab9cbc84df
2 changed files with 4 additions and 4 deletions

View File

@ -591,7 +591,7 @@ class _CountingAttr(object):
_CountingAttr = _add_cmp(_add_repr(_CountingAttr))
@attributes
@attributes(slots=True)
class Factory(object):
"""
Stores a factory callable.

View File

@ -7,7 +7,7 @@ from __future__ import absolute_import, division, print_function
from ._make import attr, attributes
@attributes(repr=False)
@attributes(repr=False, slots=True)
class _InstanceOfValidator(object):
type = attr()
@ -47,7 +47,7 @@ def instance_of(type):
return _InstanceOfValidator(type)
@attributes(repr=False)
@attributes(repr=False, slots=True)
class _ProvidesValidator(object):
interface = attr()
@ -87,7 +87,7 @@ def provides(interface):
return _ProvidesValidator(interface)
@attributes(repr=False)
@attributes(repr=False, slots=True)
class _OptionalValidator(object):
validator = attr()