Python: will id() always be nonzero? -


i’m wondering if there python object ids prevent them ever equaling zero? i’m asking because i’m using 0 stand-in special case in code.

from docs

cpython implementation detail: address of object in memory.

0 invalid memory location. no object in c ever have memory location , no object in cpython implementation ever have id of zero.

not sure other python implementations though


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -