Comments for Yet Another Python Internals Blog https://pythoninternal.wordpress.com Mon, 19 Oct 2020 12:35:23 +0000 hourly 1 http://wordpress.com/ Comment on The Garbage Collector by lpoulain https://pythoninternal.wordpress.com/2014/08/04/the-garbage-collector/comment-page-1/#comment-318 Mon, 19 Oct 2020 12:35:23 +0000 http://pythoninternal.wordpress.com/?p=70#comment-318 In reply to stef1996.

That I don’t know. That would be a question for the Python team.

Like

]]>
Comment on The Garbage Collector by stef1996 https://pythoninternal.wordpress.com/2014/08/04/the-garbage-collector/comment-page-1/#comment-317 Mon, 19 Oct 2020 10:12:38 +0000 http://pythoninternal.wordpress.com/?p=70#comment-317 Ok, why using this multi-pass “gc_ref” mechanism, instead of “just” runing an “epoch” that would directly get unreachable items then deleted them ?

Like

]]>
Comment on The Garbage Collector by lpoulain https://pythoninternal.wordpress.com/2014/08/04/the-garbage-collector/comment-page-1/#comment-316 Sun, 18 Oct 2020 17:34:15 +0000 http://pythoninternal.wordpress.com/?p=70#comment-316 In reply to stef1996.

Not really. For Java and C# have a mark-and-sweep when they kick start the GC on a regular basis. When it does, they mark the objects and then remove them. Python, on the other hand, keeps a tab on the number of references pointing to each and every object and deletes them as soon as this counter is zero. The only “mark-and-sweep” is to delete circular references.

Like

]]>
Comment on The Garbage Collector by stef1996 https://pythoninternal.wordpress.com/2014/08/04/the-garbage-collector/comment-page-1/#comment-315 Sun, 18 Oct 2020 08:59:15 +0000 http://pythoninternal.wordpress.com/?p=70#comment-315 Is it the famous “mark-and-sweep” ?

Nice article, thanks…

Like

]]>
Comment on The Garbage Collector by Python Garbage Collection – Kangho Kenneth Yoon https://pythoninternal.wordpress.com/2014/08/04/the-garbage-collector/comment-page-1/#comment-277 Sat, 16 May 2020 12:13:14 +0000 http://pythoninternal.wordpress.com/?p=70#comment-277 […] are dealt with GC module, which we can call generational cyclic GC. You can read the details here (https://pythoninternal.wordpress.com/2014/08/04/the-garbage-collector/). It is optimized using 3 generations, where new objects in young generation are scanned more […]

Like

]]>
Comment on Everything’s an object by lpoulain https://pythoninternal.wordpress.com/2014/08/11/everythings-an-object/comment-page-1/#comment-52 Sun, 24 Dec 2017 18:23:29 +0000 http://pythoninternal.wordpress.com/?p=121#comment-52 Not really. Keywords such as “def”, “=” or “class” are just a way for Python to parse the source code. When you type “def myFunc() …”, a “myFunc” object gets created but “def” is not, because it’s just a convention to tell Python that you defined a function.

Like

]]>
Comment on Everything’s an object by Moondra https://pythoninternal.wordpress.com/2014/08/11/everythings-an-object/comment-page-1/#comment-51 Sun, 24 Dec 2017 18:11:42 +0000 http://pythoninternal.wordpress.com/?p=121#comment-51 In reply to lpoulain.

Thank you. However, if everything is an object in Python, keywords should also be an object of some class right? What class are keywords objects of?

Like

]]>
Comment on Everything’s an object by lpoulain https://pythoninternal.wordpress.com/2014/08/11/everythings-an-object/comment-page-1/#comment-50 Thu, 21 Dec 2017 04:42:38 +0000 http://pythoninternal.wordpress.com/?p=121#comment-50 In reply to Moondra.

def is not a type, it is a keyword used to create a function.

Like

]]>
Comment on Everything’s an object by Moondra https://pythoninternal.wordpress.com/2014/08/11/everythings-an-object/comment-page-1/#comment-49 Thu, 21 Dec 2017 01:46:05 +0000 http://pythoninternal.wordpress.com/?p=121#comment-49 What is different about def that type(def) doesn’t work?
Is def not an object?

Like

]]>
Comment on Variables and integers by lpoulain https://pythoninternal.wordpress.com/2014/07/08/variables-and-integers/comment-page-1/#comment-7 Thu, 07 Aug 2014 19:17:48 +0000 http://pythoninternal.wordpress.com/?p=4#comment-7 In reply to xiaobingjiang.

What I meant is that the preallocated numbers seem to for the [-5, 256] range. A comment in the source says “The integers that are preallocated are those in the range -NSMALLNEGINTS (inclusive) to NSMALLPOSINTS (not inclusive).”

Like

]]>