Created
May 1, 2014 07:27
-
-
Save shichao-an/b447d24f0a5381b0fa92 to your computer and use it in GitHub Desktop.
Get integer bits of current CPython implementation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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