[issue39141] IDLE Clear function returns 256 on Mac OS Catalina

2019-12-27 Thread David Turner
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:

[issue21248] BROWSER env var described inaccurately in webbrowser docs

2014-04-15 Thread David Turner
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

[issue4327] Patch: simplify complex constant assignment statements

2008-11-24 Thread David Turner
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

[issue4327] Patch: simplify complex constant assignment statements

2008-11-24 Thread David Turner
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

[issue4327] Patch: simplify complex constant assignment statements

2008-11-24 Thread David Turner
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 &

[issue4327] Patch: simplify complex constant assignment statements

2008-11-14 Thread David Turner
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

[issue4327] Patch: simplify complex constant assignment statements

2008-11-14 Thread David Turner
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

[issue4264] Patch: optimize code to use LIST_APPEND instead of calling list.append

2008-11-07 Thread David Turner
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

[issue4264] Patch: optimize code to use LIST_APPEND instead of calling list.append

2008-11-07 Thread David Turner
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

[issue4264] Patch: optimize code to use LIST_APPEND instead of calling list.append

2008-11-06 Thread David Turner
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

[issue4264] Patch: optimize code to use LIST_APPEND instead of calling list.append

2008-11-06 Thread David Turner
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

[issue4264] Patch: optimize code to use LIST_APPEND instead of calling list.append

2008-11-05 Thread David Turner
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

[issue4141] Dis docs on CALL_FUNCTION a bit unclear

2008-10-17 Thread David Turner
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

[issue4141] Dis docs on CALL_FUNCTION a bit unclear

2008-10-17 Thread David Turner
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

[issue4134] Peephole optimization: returning a temp

2008-10-16 Thread David Turner
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

[issue4134] Peephole optimization: returning a temp

2008-10-16 Thread David Turner
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