Skip to content

Commit

Permalink
Fix #2690: Enforce slots for attrs classes
Browse files Browse the repository at this point in the history
  • Loading branch information
asvetlov committed Jan 27, 2018
1 parent 50b81c5 commit dd1986e
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions aiohttp/client_reqrep.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@
__all__ = ('ClientRequest', 'ClientResponse', 'RequestInfo', 'Fingerprint')


@attr.s(frozen=True)
@attr.s(frozen=True, slots=True)
class ContentDisposition:
type = attr.ib(type=str)
parameters = attr.ib(type=MappingProxyType)
filename = attr.ib(type=str)


@attr.s(frozen=True)
@attr.s(frozen=True, slots=True)
class RequestInfo:
url = attr.ib(type=URL)
method = attr.ib(type=str)
Expand Down
4 changes: 2 additions & 2 deletions aiohttp/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def netrc_from_env():
return netrc_obj


@attr.s(frozen=True)
@attr.s(frozen=True, slots=True)
class ProxyInfo:
proxy = attr.ib(type=str)
proxy_auth = attr.ib(type=BasicAuth)
Expand Down Expand Up @@ -192,7 +192,7 @@ def isasyncgenfunction(obj):
return False


@attr.s(frozen=True)
@attr.s(frozen=True, slots=True)
class MimeType:
type = attr.ib(type=str)
subtype = attr.ib(type=str)
Expand Down
2 changes: 1 addition & 1 deletion aiohttp/web_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
__all__ = ('BaseRequest', 'FileField', 'Request')


@attr.s(frozen=True)
@attr.s(frozen=True, slots=True)
class FileField:
name = attr.ib(type=str)
filename = attr.ib(type=str)
Expand Down
2 changes: 1 addition & 1 deletion aiohttp/web_urldispatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
PATH_SEP = re.escape('/')


@attr.s(frozen=True, repr=False)
@attr.s(frozen=True, repr=False, slots=True)
class RouteDef:
method = attr.ib(type=str)
path = attr.ib(type=str)
Expand Down
2 changes: 1 addition & 1 deletion aiohttp/web_ws.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
MsgType = WSMsgType


@attr.s(frozen=True)
@attr.s(frozen=True, slots=True)
class WebSocketReady:
ok = attr.ib(type=bool)
protocol = attr.ib(type=str)
Expand Down

0 comments on commit dd1986e

Please sign in to comment.