Re: [Python-Dev] [Python-checkins] cpython: asyncio.events: Use __slots__ in Handle and TimerHandle

On 02/12/2014 02:02 PM, yury.selivanov wrote:
Apologies up front if these are stupid questions, but: Why __slots__? Are we going to have so many of these things that memory is an issue? The asserts in the code -- those are not for checking user input, correct? -- ~Ethan~

On Wed, Feb 12, 2014 at 3:10 PM, Ethan Furman <ethan@stoneleaf.us> wrote:
There's one of these created for every callback -- which includes every time 'yield from' blocks for a Future. The savings are primarily in allocation cost (no dicts to allocate).
The asserts in the code -- those are not for checking user input, correct?
Yeah, this class is never instantiated directly by the user. -- --Guido van Rossum (python.org/~guido)

On Wed, Feb 12, 2014 at 3:10 PM, Ethan Furman <ethan@stoneleaf.us> wrote:
There's one of these created for every callback -- which includes every time 'yield from' blocks for a Future. The savings are primarily in allocation cost (no dicts to allocate).
The asserts in the code -- those are not for checking user input, correct?
Yeah, this class is never instantiated directly by the user. -- --Guido van Rossum (python.org/~guido)
participants (2)
-
Ethan Furman
-
Guido van Rossum