R. Bernstein

Results 267 issues of R. Bernstein

The following when compiled doesn't decompile in any version of Python 3 (for differing reasons): Also note that this program is self-checking. You can run the program after deompiling and...

Here is a sample program that produces `GET_AITER`: ``` async def a(b, c): async for b in c: pass ```

Compile/decompile of: ``` # From 3.0.1 _abcoll.py def __and__(self, other): if not isinstance(other, Iterable): return NotImplemented return self._from_iterable(value for value in other if value in self) ``` gives: ``` #...

Consider: ```python # From Python 3.0 _markupbase.py. # # The Problem was in the way "if"s are generated in 3.0 which is sort # of like a more optimized Python...

Similar but slightly different is the funky Python 2.6, 3.0 and 3.1 "with .. as" statements. https://github.com/rocky/python-uncompyle6/blob/master/test/bytecode_3.1/04_withas.pyc fails. (Also the same thing is try for 2.6). The source code is...

In python 3 (specifically 3.3 and 3.5 possibly among others): ```lambda *, d=0: None``` comes out as ```(lambda : pass)```

I realize chained comparisons in Python versions before 3.7 is lacking, however in 3.7 the discrepency is close enough that it might be handled easily. Here is Python some python...

compiling in Python 3.0.1 and decompiling : ``` # From 3.0 ccompiler.py def executable_filename(self, basename, join, output_dir=''): return join(output_dir, basename + (self.exe_extension or '')) ``` gives: ``` def executable_filename(self, basename,...

Python 3.0 is a snowflake in a number of ways and in some ways is more like 2.6 than 3.0. Sometimes loop comprehensions generate code creating internal variables like _[1]...

Python 2.7.5 generates different code from later 2.7 versions. This ``` ms=0 if ms==1: while 1: pass ``` produces: ``` ms = 0 if ms == 1: while None: continue...