|
Is there anything like the JVM spec but for Python? I want to know what I can assume about the way Python works. I want to know what's the memory overhead for creating an object, for example. How many bits are in an integer? And so on. I don't want to cobble together answers from StackOverflow that maybe describe the behavior of a specific Python implementation that isn't necessarily fixed, for example. Also, I'd like to separately (so that I know what is prescribed for all Python implementations, and what is specific to or just an implementation detail of the most popular implementation) about the internals of the most popular Python implementation. I'm guessing that's CPython, but I imagine 2.7 and 3.blah are pretty different. In general, though, I want to know stuff like how does garbage collection work in CPython? What happens when I create a thread? How do locks work? Java has a bunch of explanation about "happens-before" relationships when writing multi-threaded programs - what's the Python equivalent?
|
# ¿ Apr 1, 2017 20:01 |
|
|
# ¿ May 2, 2024 09:33 |
|
Ugh. From the Python documentation, "Floating point numbers are usually implemented using double in C;": https://docs.python.org/2/library/stdtypes.html#numeric-types-int-float-long-complex "Usually". So what's the behavior I can assume I always have?
|
# ¿ Apr 1, 2017 20:16 |
|
The Python documentation says "Long integers are now stored internally either in base 2**15 or in base 2**30": https://docs.python.org/2.7/whatsnew/2.7.html#optimizations What does that mean? I have never seen "base 2 to some power" used before. 2**15 = 32,768 and I really doubt this means that Python uses a base-32,768 number representation.
|
# ¿ Apr 7, 2017 04:36 |