Closed cwells closed 2 years ago
Actually it shouldn't be GRANULARITIES
since that is a class, not instance var.
Thanks for the report, turns out the current implementation (even if we ignore the extra granularities
slot), was actually
causing the objects to be as large as if they would be without __slots__
>>> from pympler.asizeof import asizeof
>>> from limits import parse_many
>>> asizeof(parse_many(",".join(["1/second"] * 100000))) / 1024.0 / 1024.0
15.259986877441406
>>> from pympler.asizeof import asizeof
>>> from limits import parse_many
>>> asizeof(parse_many(",".join(["1/second"] * 100000))) / 1024.0 / 1024.0
15.259811401367188
RateLimitIterPerSecond
etc..)>>> from pympler.asizeof import asizeof
>>> from limits import parse_many
>>> asizeof(parse_many(",".join(["1/second"] * 100000))) / 1024.0 / 1024.0
6.1045379638671875
I'm presuming this was intended to be
GRANULARITY
:https://github.com/alisaifee/limits/blob/5facdd5c2b6a44006d60a96b3ab1152367e3c176/limits/limits.py#L65
Confusing when
dir(rate)
shows a non-existent attribute.