From a985b4593d3f0c788c5e6ef0066bf82ae550cfb8 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Wed, 9 Apr 2014 00:40:58 +0300 Subject: objint: Implement int.from_bytes() class method and .to_bytes() method. These two are apprerently the most concise and efficient way to convert int to/from bytes in Python. The alternatives are struct and array modules, but methods using them are more verbose in Python code and less efficient in memory/cycles. --- py/qstrdefs.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'py/qstrdefs.h') diff --git a/py/qstrdefs.h b/py/qstrdefs.h index 29eb51d0ba..0c2c032f29 100644 --- a/py/qstrdefs.h +++ b/py/qstrdefs.h @@ -96,6 +96,7 @@ Q(eval) Q(exec) Q(filter) Q(float) +Q(from_bytes) Q(getattr) Q(globals) Q(hash) @@ -127,6 +128,7 @@ Q(sum) Q(super) Q(str) Q(sys) +Q(to_bytes) Q(tuple) Q(type) Q(value) -- cgit v1.2.3