New submission from David Turner :
Trying to set up shortcut function to clear screen but its not working as
expected on my Mac OS Catalina -- below is txt from idle
import os
>>> cls= lambda: os.system('clear')
>>> cls()
256
--
messages: 358908
nosy:
New submission from David Turner:
https://docs.python.org/2/library/webbrowser.html says "If the environment
variable BROWSER exists, it is interpreted to override the platform default
list of browsers, as a os.pathsep-separated list of browsers to try in order."
This is not act
David Turner <[EMAIL PROTECTED]> added the comment:
Everything in optimize.c is about modifying the AST (this is on tlee's
ast optimization branch, in case I didn't mention earlier). Also,
changing asdl_seq_SET would be a bad idea, since it is used for
sequences of things oth
David Turner <[EMAIL PROTECTED]> added the comment:
Sure, but that's an even bigger change. Every piece of code which
modifies the AST would now also have to modify parent pointers. Having
the pointers would make many things easier, but I didn't want to make a
very invasive
David Turner <[EMAIL PROTECTED]> added the comment:
jhylton, keep in mind that this would require an additional "parent"
argument to each function which takes a stmt. Do you think this added
complexity is worth it?
___
Python tracker &
David Turner <[EMAIL PROTECTED]> added the comment:
Oh, and this also involved the creation of an additional statement type,
unfortunately. The statement type, Seq, represents a sequence of
statements. This is so that we can replace a single assign with
multiple assigns. If that
New submission from David Turner <[EMAIL PROTECTED]>:
This patch adds functionality to the optimizer to simplify complex
constant assignments like:
a, (b, c) = d, e = 1, (2, 3)
The simplification is:
a = 1
d = 1
b, c = e = 2, 3
Of course, the simplified version is semantically ide
David Turner <[EMAIL PROTECTED]> added the comment:
> Obviously if there's another sufficiently good argument for the visitor
> approach, I'm all ears. But again, if we do that I think we should do
> it for the compiler as well. I'm not sure how much support suc
David Turner <[EMAIL PROTECTED]> added the comment:
> FWIW, I see exposing bytecodes as an anti-pattern that locks in a
> particular implementation in a way that makes it hard to change and
> hard to port to other Python implementations. The current bound
> method approach
David Turner <[EMAIL PROTECTED]> added the comment:
Actually, I just noticed a case where the code would do the wrong thing.
I fixed it and added a test for it.
Added file: http://bugs.python.org/file11958/tlee-ast-optimize-appends-3.diff
___
Python t
David Turner <[EMAIL PROTECTED]> added the comment:
Neal Norwitz <[EMAIL PROTECTED]> added the comment:
>
> Interesting approach. I was surprised to see the change to the AST,
> but I understand why you did it. I think if the AST optimization
> approach works out we
New submission from David Turner <[EMAIL PROTECTED]>:
This is a patch to Tom Lee's AST optimization branch.
Python bytecode includes at least one operation which is not directly
accessible from Python code: LIST_APPEND, which pops a value and a list
off the stack and appends the v
Changes by David Turner <[EMAIL PROTECTED]>:
--
assignee: -> georg.brandl
components: +Documentation
nosy: +georg.brandl
versions: +Python 2.7
___
Python tracker <[EMAIL PROTECTED]>
<http://bugs.py
New submission from David Turner <[EMAIL PROTECTED]>:
This patch improves them.
--
files: dis-doc-patch.diff
keywords: patch
messages: 74928
nosy: novalis_dt
severity: normal
status: open
title: Dis docs on CALL_FUNCTION a bit unclear
Added file: http://bugs.python.org/file11821/d
David Turner <[EMAIL PROTECTED]> added the comment:
The idiom appears at least 370 times in the standard library. And,
while on its own it can't appear in a loop, a function that uses it
might get called in a loop.
You mention some sort of AST optimizer. I haven't really
New submission from David Turner <[EMAIL PROTECTED]>:
This patch adds an optimization to the peephole optimizer for the common
case of:
def func(...):
...
retval = ...
return retval
Before the patch, the compiler would generate
STORE_FAST 3
LOAD_FAST 3
RETURN_VALUE
The store an
16 matches
Mail list logo