On Sat, Sep 28, 2019 at 5:56 PM Dino Viehland <dinoviehl...@gmail.com>
wrote:

> Hm... But then you'd be paying for boxing/unboxing cost on each access.
>> I'm actually okay with needing to use Cython if you're really that tight
>> for space.
>>
>>
>
> Right, but those would be rather ephemeral vs more potentially long lived
> members.  It'll certainly depend upon the usage pattern whether or not it's
> worth it.  And the point of using __slots__ is that you've decided you're
> tight on space but we don't force usage of Cython to go dict-free.
>

Well, I expect the implementation to be too hairy to bother.


> But you could do that without the wacky API by just naming the slots _foo,
>> _bar and have properties foo, bar.
>>
>
> You can also just mutate the type after the fact and replace the
> descriptor with the wrapped descriptor.  Wouldn't the prefixed solution
> work just as well for dataclasses in some form as well?
>

SOrry, I lost track of what you call "prefixed".

-- 
--Guido van Rossum (python.org/~guido)
*Pronouns: he/him **(why is my pronoun here?)*
<http://feministing.com/2015/02/03/how-using-they-as-a-singular-pronoun-can-change-the-world/>
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/TNLPW2SMT2O665GM6IGKP3T4NKT3PZ2D/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to