Wykres commitów

9 Commity (ed570e4b2a0a68e43b191fb0d5b45fb2ec83aca4)

Autor SHA1 Wiadomość Data
Damien George c5029bcbf3 py: Add MP_BINARY_OP_DIVMOD to simplify and consolidate divmod builtin. 2015-06-13 23:36:30 +01:00
Damien George c2a4e4effc py: Convert hash API to use MP_UNARY_OP_HASH instead of ad-hoc function.
Hashing is now done using mp_unary_op function with MP_UNARY_OP_HASH as
the operator argument.  Hashing for int, str and bytes still go via
fast-path in mp_unary_op since they are the most common objects which
need to be hashed.

This lead to quite a bit of code cleanup, and should be more efficient
if anything.  It saves 176 bytes code space on Thumb2, and 360 bytes on
x86.

The only loss is that the error message "unhashable type" is now the
more generic "unsupported type for __hash__".
2015-05-12 22:46:02 +01:00
Damien George 9a42eb541e py: Fix naming of function arguments when function is a closure.
Addresses issue #1226.
2015-05-06 13:55:33 +01:00
Damien George 367d4d1098 tests: Fix cmd_showbc now that LOAD_CONST_ELLIPSIS bytecode is gone. 2015-05-05 23:58:52 +01:00
Damien George 8c1d23a0e2 py: Modify bytecode "with" behaviour so it doesn't use any heap.
Before this patch a "with" block needed to create a bound method object
on the heap for the __exit__ call.  Now it doesn't because we use
load_method instead of load_attr, and save the method+self on the stack.
2015-04-24 01:52:28 +01:00
Damien George c9aa1883ed py: Simplify bytecode prelude when encoding closed over variables. 2015-04-07 00:08:17 +01:00
Damien George 1004535237 tests: Make cmdline tests more stable by using regex for matching. 2015-03-20 17:25:25 +00:00
Damien George 0683c1ceef tests: Don't try to verify amount of memory used in cmd_showbc test. 2015-03-14 17:38:41 +00:00
Damien George 703c009681 tests: Add cmdline test to test showbc code. 2015-03-14 14:06:20 +00:00