summaryrefslogtreecommitdiffstats
path: root/Modules/cryptmodule.c
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2000-09-21 05:43:11 (GMT)
committerTim Peters <tim.peters@gmail.com>2000-09-21 05:43:11 (GMT)
commit38fd5b641366eedc74e4be3a0e4d2210f3bcdb5a (patch)
tree38536cf33e6f83fa3ca8af62dbafebcd4dfd5921 /Modules/cryptmodule.c
parent31575ce8172d40575be3c3d7a3a4a51d4aaf1a86 (diff)
downloadcpython-38fd5b641366eedc74e4be3a0e4d2210f3bcdb5a.zip
cpython-38fd5b641366eedc74e4be3a0e4d2210f3bcdb5a.tar.gz
cpython-38fd5b641366eedc74e4be3a0e4d2210f3bcdb5a.tar.bz2
Derived from Martin's SF patch 110609: support unbounded ints in %d,i,u,x,X,o formats.
Note a curious extension to the std C rules: x, X and o formatting can never produce a sign character in C, so the '+' and ' ' flags are meaningless for them. But unbounded ints *can* produce a sign character under these conversions (no fixed- width bitstring is wide enough to hold all negative values in 2's-comp form). So these flags become meaningful in Python when formatting a Python long which is too big to fit in a C long. This required shuffling around existing code, which hacked x and X conversions to death when both the '#' and '0' flags were specified: the hacks weren't strong enough to deal with the simultaneous possibility of the ' ' or '+' flags too, since signs were always meaningless before for x and X conversions. Isomorphic shuffling was required in unicodeobject.c. Also added dozens of non-trivial new unbounded-int test cases to test_format.py.
Diffstat (limited to 'Modules/cryptmodule.c')
0 files changed, 0 insertions, 0 deletions