From a21abe0c6e23448c9d0ad62f05cac8c7b7fac74a Mon Sep 17 00:00:00 2001 From: John Belmonte Date: Mon, 5 Apr 2021 10:46:39 +0900 Subject: [PATCH] use slots for ParkingLot and Event closes #1943 --- trio/_core/_parking_lot.py | 2 +- trio/_sync.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/trio/_core/_parking_lot.py b/trio/_core/_parking_lot.py index 8b114b5230..a75c81c81d 100644 --- a/trio/_core/_parking_lot.py +++ b/trio/_core/_parking_lot.py @@ -85,7 +85,7 @@ class _ParkingLotStatistics: tasks_waiting = attr.ib() -@attr.s(eq=False, hash=False) +@attr.s(eq=False, hash=False, slots=True) class ParkingLot(metaclass=Final): """A fair wait queue with cancellation and requeueing. diff --git a/trio/_sync.py b/trio/_sync.py index bed339ef6b..68f3e82b05 100644 --- a/trio/_sync.py +++ b/trio/_sync.py @@ -10,7 +10,7 @@ from ._util import Final -@attr.s(repr=False, eq=False, hash=False) +@attr.s(repr=False, eq=False, hash=False, slots=True) class Event(metaclass=Final): """A waitable boolean value useful for inter-task synchronization, inspired by :class:`threading.Event`.