[Python-ideas] hybrid implementation for PyLongObject (performance)

2019-08-12 Thread malincns
The idea is mixing `PyLongObject` with `Python 2's PyIntObject` implementation. For example, on a 64-bit platform, if (an integer >=-9223372036854775808 and <=9223372036854775807), PyLongObject uses a native C type `signed long` to represent it. People mostly use +-* operations, maybe using nat

[Python-ideas] Re: hybrid implementation for PyLongObject (performance)

2019-08-13 Thread malincns
在 19-8-13 1:27, Andrew Barnert via Python-ideas 写道: > On Aug 11, 2019, at 19:01, malin...@163.com wrote: >> >> The idea is mixing `PyLongObject` with `Python 2's PyIntObject` >> implementation. >> >> For example, on a 64-bit platform, if (an integer >=-9223372036854775808 and >> <=922337203685477

[Python-ideas] Add _KB, _MB, _GB to numeric literals

2020-10-13 Thread malincns
PEP 515 added underscore to numeric literals, it brings better readability. PEP 515 -- Underscores in Numeric Literals https://www.python.org/dev/peps/pep-0515/ Is it possible to add _KB, _MB, _GB to numeric literals, for example: 200_KB (200*1024) 150_MB (150*1024*1024)