[Python-ideas] Do we need non-heap types any more? (Was: Implicit submodule imports)

Nathaniel Smith njs at pobox.com
Sat Sep 27 02:23:08 CEST 2014


On 27 Sep 2014 01:08, "Antoine Pitrou" <solipsis at pitrou.net> wrote:
>
> On Sat, 27 Sep 2014 01:03:04 +0100
> Nathaniel Smith <njs at pobox.com> wrote:
> > Static type objects are still subject to the refcounting machinery in
> > most cases (try sys.getrefcount(int)),
>
> So what about it? :-)
>
> >>> sys.getrefcount(int)
> 69
> >>> x = list(range(10000))
> >>> sys.getrefcount(int)
> 69

Yes, that's why I said "most cases", not all cases :-).

My point was that being statically allocated doesn't make list a special
snowflake that *needs* some sort of protection from refcounting. If heap
and non-heap types were treated the same in this regard then nothing
horrible would happen.

-n
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20140927/8c6594b6/attachment.html>


More information about the Python-ideas mailing list