Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Get integer bits of current CPython implementation
import sys
def get_int_bits():
if hasattr(sys, 'maxsize'):
max_int = getattr(sys, 'maxsize')
else:
max_int = getattr(sys, 'maxint')
if max_int >> 62 == 0:
return 32
else:
return 64
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.