As a general rule, you should not expect the bytecode to be the same
between different versions of CPython, including minor version changes. For
example, the instructions for dictionary literals are different in 3.4,
3.5, and 3.6.
On Fri, Jan 19, 2018 at 6:54 PM, Victor Stinner
wrote:
> Python b
Currently there are many ways to introduce variables in Python; however,
only a few allow annotations. I was working on a toy language and chose to
base my syntax on Python's when I noticed that I could not annotate a loop
iteration variable. For example:
for x: int in range(5):
...
This led
t; This was rejected because in ``for`` it would make it hard to spot the
> actual
> iterable, and in ``with`` it would confuse the CPython's LL(1) parser.
>
>
> On Thu, Jan 25, 2018 at 3:17 PM, Jelle Zijlstra
> wrote:
>
>>
>>
>> 2018-01-25 15
METH_FASTCALL passing arguments on the stack doesn't necessarily mean it
will be slow. In x86 there are calling conventions that read all the
arguments from the stack, but the rest of the machine is register based.
Python could also look at ABI calling conventions for inspiration, like
x86-64 where
Is it true that checking for refcount == 1 is enough? What if a user wrote:
args = (compute_integer(), 5)
# give away args to someone
int.__iadd__(*args)
here `args[0]` still has refcount=1 because only `args` owns this integer.
On Fri, Sep 1, 2017 at 4:19 PM, Jelle Zijlstra
wrote:
>
>
> 2017-
The string concat optimization happens in the interpreter dispatch for
INPLACE_ADD
On Fri, Sep 1, 2017 at 9:10 PM, Greg Ewing
wrote:
> Chris Angelico wrote:
>
>> This particular example is safe, because the arguments get passed
>> individually - so 'args' has one reference, plus there's one more
I think this probably belongs on python-list instead of python-dev because
python-dev is for development _of_ python, not _with_ python.
To answer your question though, there are a few tools that do this:
- https://github.com/vstinner/bytecode
- https://github.com/ll/codetransformer
I am