Re: ANN: dedent 0.5 released

2016-09-29 Thread Vito De Tullio
Christian Tismer wrote: > $ python -c """some code""" totally offtopic but... since when bash support python-style triple quote?? Is it another shell?? -- By ZeD -- https://mail.python.org/mailman/listinfo/python-list

[issue28294] HTTPServer server.py assumes sys.stderr != None

2016-09-29 Thread Mariatta Wijaya
Mariatta Wijaya added the comment: use the logging module instead of sys.stderr -- keywords: +patch Added file: http://bugs.python.org/file44890/issue28294.patch ___ Python tracker

[issue28295] PyUnicode_AsUCS4 doc and impl conflict on exception

2016-09-29 Thread Xiang Zhang
Xiang Zhang added the comment: v2 now adds more tests and change the problematic variable name. -- Added file: http://bugs.python.org/file44889/PyUnicode_AsUCS4_v2.patch ___ Python tracker

Re: unintuitive for-loop behavior

2016-09-29 Thread Rustom Mody
On Friday, September 30, 2016 at 10:23:31 AM UTC+5:30, Gregory Ewing wrote: > namenobodywants wrote: > > can anyone help to reconcile me to this semantics? > > Not really. Most people agree that it's not desirable > behaviour, but we've ended up here due to a convoluted > history, and there

[issue28199] Compact dict resizing is doing too much work

2016-09-29 Thread INADA Naoki
INADA Naoki added the comment: As written in comment, reusing keys object breaks odict implementation. I think we can't avoid copy for Python 3.6. -- keywords: +patch Added file: http://bugs.python.org/file44888/dictresize.patch ___ Python tracker

Re: unintuitive for-loop behavior

2016-09-29 Thread Gregory Ewing
namenobodywa...@gmail.com wrote: > can anyone help to reconcile me to this semantics? Not really. Most people agree that it's not desirable behaviour, but we've ended up here due to a convoluted history, and there doesn't seem to be a good way to fix it without breaking a lot of existing code.

Python grammar extension via encoding (pyxl style) questions

2016-09-29 Thread Pavel Velikhov
Hi everybody! We’re building an experimental extension to Python, we’re extending Python’s comprehensions into a full-scale query language. And we’d love to use the trick that was done in pyxl, where a special encoding of the file will trigger the preprocessor to run and compile our

[issue28226] compileall does not support pathlib

2016-09-29 Thread Berker Peksag
Changes by Berker Peksag : Added file: http://bugs.python.org/file44887/issue28226_v3.diff ___ Python tracker ___

Re: how to automate java application in window using python

2016-09-29 Thread Michael Torrie
On 09/29/2016 01:18 PM, Lawrence D’Oliveiro wrote: > On Thursday, September 29, 2016 at 11:46:59 PM UTC+13, Ned Batchelder wrote: >> This is just getting rude. Let's please drop it. > > Do you have anything substantive to contribute? He's already contributed far more to this list, and to

[issue28226] compileall does not support pathlib

2016-09-29 Thread Berker Peksag
Berker Peksag added the comment: > Is there a fix for compileall missing from the patch? No, os.path.* functions have taken care of the conversion, but the output was in the following format: Compiling PosixPath('/tmp/tmp_nfh98lw/_test.py')... I fixed it, added a test for the ddir

[issue27100] Attempting to use class with both __enter__ & __exit__ undefined yields __exit__ attribute error

2016-09-29 Thread Nick Coghlan
Nick Coghlan added the comment: Due to the expected semantics of AttributeError being relatively precise, changing to a protocol check rather than just changing the order we look up the protocol attributes would also involving changing from AttributeError to TypeError. Since that's a

[issue27854] Installed 2.7: IDLE Help disabled because help.html is missing

2016-09-29 Thread Ned Deily
Changes by Ned Deily : -- components: +Windows nosy: +paul.moore, steve.dower, tim.golden, zach.ware ___ Python tracker ___

[issue28315] incorrect "in ?" output in 'divide' example at "Defining Clean-up Actions" in tutorial

2016-09-29 Thread Mariatta Wijaya
Mariatta Wijaya added the comment: Updated the documentation to use instead of ? I also went through other examples in the page and fixed those too. -- keywords: +patch Added file: http://bugs.python.org/file44885/issue28315.patch ___ Python

[issue28315] incorrect "in ?" output in 'divide' example at "Defining Clean-up Actions" in tutorial

2016-09-29 Thread Mariatta Wijaya
Mariatta Wijaya added the comment: Thanks for the report. I agree, it should be instead of ? I'll work on a patch for this :) -- ___ Python tracker ___

Re: Expression can be simplified on list

2016-09-29 Thread Steve D'Aprano
On Fri, 30 Sep 2016 05:58 am, Random832 wrote: > On Thu, Sep 29, 2016, at 02:47, Rustom Mody wrote: >> Your example is exactly what I am saying; if a type has a behavior in >> which all values are always True (true-ish) its a rather strange kind >> of bool-nature. > > For a given type T, if all

[issue28315] incorrect "in ?" output in 'divide' example at "Defining Clean-up Actions" in tutorial

2016-09-29 Thread Mariatta Wijaya
Changes by Mariatta Wijaya : -- nosy: +Mariatta ___ Python tracker ___ ___

[issue28228] imghdr does not support pathlib

2016-09-29 Thread Berker Peksag
Berker Peksag added the comment: Here's a new patch that addresses Serhiy's comments. Let me know if you need a hand with review and commit these patches this weekend :) -- nosy: +berker.peksag Added file: http://bugs.python.org/file44884/issue28228_v2.diff

[issue28315] incorrect "in ?" output in 'divide' example at "Defining Clean-up Actions" in tutorial

2016-09-29 Thread Viorel Tabara
New submission from Viorel Tabara: At https://docs.python.org/3.5/tutorial/errors.html#defining-clean-up-actions when I'm running the "divide('2', '1')" example I get: File "", line 1, in instead of the documentation output of: File "", line 1, in ? The same message is included with

Re: how to automate java application in window using python

2016-09-29 Thread Steve D'Aprano
On Fri, 30 Sep 2016 05:18 am, Lawrence D’Oliveiro wrote: > On Thursday, September 29, 2016 at 11:46:59 PM UTC+13, Ned Batchelder > wrote: >> This is just getting rude. Let's please drop it. > > Do you have anything substantive to contribute? Infinitely more than you. *plonk* -- Steve

Re: how to automate java application in window using python

2016-09-29 Thread Chris Angelico
On Fri, Sep 30, 2016 at 5:18 AM, Lawrence D’Oliveiro wrote: > On Thursday, September 29, 2016 at 11:46:59 PM UTC+13, Ned Batchelder wrote: >> This is just getting rude. Let's please drop it. > > Do you have anything substantive to contribute? Yes. He contributed the

Re: unintuitive for-loop behavior

2016-09-29 Thread Chris Angelico
On Fri, Sep 30, 2016 at 5:29 AM, wrote: > i've had a nodding acquaintance with python for some time, and all along i > assumed that for-loops got a namespace of their own; now i'm reading up on > the language and i find out that's not the case: the loop variable gets

[issue23740] http.client request and send method have some datatype issues

2016-09-29 Thread Mariatta Wijaya
Changes by Mariatta Wijaya : -- nosy: +Mariatta ___ Python tracker ___ ___

[issue28313] ttk Style().configure() overwrites Tk().option_add() Button but not Label

2016-09-29 Thread qubodup
qubodup added the comment: Thank you for clarifying, reported at http://core.tcl.tk/tk/tktview/1dde2144bdcc5a93f8724fc1b1b85b19114e42c0 -- ___ Python tracker

Re: Getting IDLE to use correct Tcl/Tk on MacOSX 10.6?

2016-09-29 Thread Ned Deily
On 2016-09-27 18:47, Gregory Ewing wrote: > I don't normally use IDLE, but I had occasion to use it > on MacOSX 10.6 to answer someone's question, and of course > it didn't work properly due to Apple's broken Tcl/Tk. > > I followed the advice to install ActiveState Tcl 8.5.18.0, > but my Python

[issue21879] str.format() gives poor diagnostic on placeholder mismatch

2016-09-29 Thread Mariatta Wijaya
Changes by Mariatta Wijaya : -- nosy: +Mariatta ___ Python tracker ___ ___

Re: Expression can be simplified on list

2016-09-29 Thread Chris Angelico
On Fri, Sep 30, 2016 at 5:58 AM, Random832 wrote: > On Thu, Sep 29, 2016, at 02:47, Rustom Mody wrote: >> Your example is exactly what I am saying; if a type has a behavior in >> which all values are always True (true-ish) its a rather strange kind >> of bool-nature. > >

[issue28222] test_distutils fails

2016-09-29 Thread Mariatta Wijaya
Changes by Mariatta Wijaya : -- nosy: +Mariatta ___ Python tracker ___ ___

Re: ANN: dedent 0.5 released

2016-09-29 Thread Christian Tismer
On 29/09/16 22:14, Lele Gaifax wrote: Christian Tismer writes: Dedent 0.5 == What is it? --- Dedent is a very simple tool for those people who like to indent their inline code nicely. p.s.: Why is that not build in by default? Isn't it roughly the

[issue28298] can't set big int-like objects to items in array 'Q', 'L' and 'I'

2016-09-29 Thread Oren Milman
Oren Milman added the comment: Ah, I should have read more about __int__ and __index__ before writing my last reply. So IIUC, this is a somewhat painful issue, which could be resolved by: * #20092 * replacing _PyLong_FromNbInt with PyNumber_Index in: - Objects/longobject.c (as

[issue28228] imghdr does not support pathlib

2016-09-29 Thread Brett Cannon
Brett Cannon added the comment: According to https://www.python.org/dev/peps/pep-0494/#schedule, 2.6.0b2 is due on Sunday. Do you think you will be able to commit this and the other patches for PathLike support by then, Ethan? -- ___ Python tracker

[issue28313] ttk Style().configure() overwrites Tk().option_add() Button but not Label

2016-09-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This is not Tkinter issue. Pure Tcl/Tk script shows the same result. If this is a bug (I don't know), this is Tk bug. -- nosy: +serhiy.storchaka resolution: -> third party stage: -> resolved status: open -> closed Added file:

[issue28258] Broken python-config generated with Estonian locale

2016-09-29 Thread Roundup Robot
Roundup Robot added the comment: New changeset 17f2b6b2e24c by Victor Stinner in branch '3.5': Issue #28258: Explain the LC_ALL change in a comment https://hg.python.org/cpython/rev/17f2b6b2e24c New changeset f256bd5b8418 by Victor Stinner in branch '2.7': Issue #28258: Explain the LC_ALL

[issue28314] ElementTree: Element.getiterator(tag) broken in 3.6

2016-09-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is a test. -- Added file: http://bugs.python.org/file44882/test_getiterator.patch ___ Python tracker ___

[issue28314] ElementTree: Element.getiterator(tag) broken in 3.6

2016-09-29 Thread STINNER Victor
STINNER Victor added the comment: I pushed the first obvious fix to unblock the 3.6 beta 2 release scheduled for next monday. -- priority: release blocker -> ___ Python tracker

Re: ANN: dedent 0.5 released

2016-09-29 Thread Lele Gaifax
Christian Tismer writes: > Dedent 0.5 > == > > What is it? > --- > > Dedent is a very simple tool for those people who like to > indent their inline code nicely. > > p.s.: Why is that not build in by default? Isn't it roughly the same as

[issue28314] ElementTree: Element.getiterator(tag) broken in 3.6

2016-09-29 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +serhiy.storchaka ___ Python tracker ___

[issue28314] ElementTree: Element.getiterator(tag) broken in 3.6

2016-09-29 Thread Roundup Robot
Roundup Robot added the comment: New changeset 1e29dca5dc4c by Victor Stinner in branch '3.6': Fix xml.etree.ElementTree.Element.getiterator() https://hg.python.org/cpython/rev/1e29dca5dc4c -- nosy: +python-dev ___ Python tracker

[issue28314] ElementTree: Element.getiterator(tag) broken in 3.6

2016-09-29 Thread STINNER Victor
Changes by STINNER Victor : -- priority: critical -> release blocker ___ Python tracker ___

[issue28314] ElementTree: Element.getiterator(tag) broken in 3.6

2016-09-29 Thread STINNER Victor
STINNER Victor added the comment: Oh... Modules/_elementtree.c uses a function defined in Modules/clinic/_elementtree.c. It hardcodes flags, whereas flags changed. Maybe the alias should be created differently to avoid such issue in the future? Moreover, obviously, we lack unit tests on this

Re: Expression can be simplified on list

2016-09-29 Thread Random832
On Thu, Sep 29, 2016, at 02:47, Rustom Mody wrote: > Your example is exactly what I am saying; if a type has a behavior in > which all values are always True (true-ish) its a rather strange kind > of bool-nature. For a given type T, if all objects of type T are true (true-ish, truthy, whatever),

[issue28314] ElementTree: Element.getiterator(tag) broken in 3.6

2016-09-29 Thread STINNER Victor
STINNER Victor added the comment: The bug seems related to the new FASTCALL calling convention introduced in Python 3.6b1. For an unknown reason, the METH_FASTCALL defined in Modules/clinic/_elementtree.c on _elementtree_Element_iter() seems to be ignored or lost somewhere? -- nosy:

Re: unintuitive for-loop behavior

2016-09-29 Thread Brendan Abel
Yes, loops don't have their own scope. Indeed, very few flow elements in python -- if, with, try/except -- create a new scope. In that sense, it's fairly consistent, but can be unexpected for people that have used languages with many nested scopes. The lambda behavior is a common gotcha - there

[issue28258] Broken python-config generated with Estonian locale

2016-09-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > Oh. I expected at least "export LANG" somewhere. IMHO it deserves a comment > explaining the surprising ";". I don't know if export is needed. I see the same behavior with and without export. > Does it work if it's written on two lines? No, it doesn't

[issue28314] ElementTree: Element.getiterator(tag) broken in 3.6

2016-09-29 Thread Ned Deily
Ned Deily added the comment: Even better: Python 3.6.0b1 (v3.6.0b1:5b0ca4ed5e2f, Sep 12 2016, 09:24:46) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> from xml.etree.ElementTree import Element >>> el =

[issue28183] Clean up and speed up dict iteration

2016-09-29 Thread STINNER Victor
STINNER Victor added the comment: Serhiy Storchaka added the comment: > It looks to me that the patch contain unneeded changes. Some changes don't > affect performance, others don't look well justified. Are there benchmarks > that confirm the benefit of these changes? Hum, since I expect

Re: Expression can be simplified on list

2016-09-29 Thread Terry Reedy
On 9/29/2016 2:47 AM, Rustom Mody wrote: On Thursday, September 15, 2016 at 1:43:05 AM UTC+5:30, Terry Reedy wrote: On 9/14/2016 3:16 AM, Rustom Mody wrote: In THOSE TYPES that element can justifiably serve as a falsey (empty) type However to extrapolate from here and believe that ALL TYPES

[issue28314] ElementTree: Element.getiterator(tag) broken in 3.6

2016-09-29 Thread Dmitry Shachnev
New submission from Dmitry Shachnev: The documentation says that getiterator() still accepts a tag argument, but it does not: >>> from xml.etree.ElementTree import Element >>> el = Element('foo') >>> el.getiterator('bar') Traceback (most recent call last): File "", line 1, in SystemError:

[issue28258] Broken python-config generated with Estonian locale

2016-09-29 Thread STINNER Victor
STINNER Victor added the comment: "Expansion is performed here by shell (spawned by make) itself before arguments are passed to find. So LC_ALL=C must be set as a separate command." Oh. I expected at least "export LANG" somewhere. IMHO it deserves a comment explaining the surprising ";".

unintuitive for-loop behavior

2016-09-29 Thread namenobodywants
hello pythonistas i've had a nodding acquaintance with python for some time, and all along i assumed that for-loops got a namespace of their own; now i'm reading up on the language and i find out that's not the case: the loop variable gets put into the enclosing namespace, overwriting any

[issue28295] PyUnicode_AsUCS4 doc and impl conflict on exception

2016-09-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: In general the patch LGTM. I have small doubt about the name of one variable, and may be worth to add yet few tests. -- ___ Python tracker

Re: how to automate java application in window using python

2016-09-29 Thread Lawrence D’Oliveiro
On Thursday, September 29, 2016 at 11:46:59 PM UTC+13, Ned Batchelder wrote: > This is just getting rude. Let's please drop it. Do you have anything substantive to contribute? (... crickets ...) -- https://mail.python.org/mailman/listinfo/python-list

[issue28183] Clean up and speed up dict iteration

2016-09-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It looks to me that the patch contain unneeded changes. Some changes don't affect performance, others don't look well justified. Are there benchmarks that confirm the benefit of these changes? -- ___ Python

[issue28258] Broken python-config generated with Estonian locale

2016-09-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This is the question that I asked Arfrever. -- ___ Python tracker ___ ___

[issue28258] Broken python-config generated with Estonian locale

2016-09-29 Thread STINNER Victor
STINNER Victor added the comment: "LC_ALL=C; find" are you sure for ";"? -- ___ Python tracker ___ ___

[issue18378] locale.getdefaultlocale() fails on Mac OS X with default language set to English

2016-09-29 Thread Lawrence Velázquez
Changes by Lawrence Velázquez : -- nosy: +larryv ___ Python tracker ___ ___ Python-bugs-list

Re: Expression can be simplified on list

2016-09-29 Thread Terry Reedy
On 9/29/2016 12:36 PM, MRAB wrote: On 2016-09-29 16:56, Steve D'Aprano wrote: On Thu, 29 Sep 2016 09:53 pm, MRAB wrote: What if an _exhausted_ iterator was falsey? Logic is about binary distinctions, rather than about 'truth'. For non-buggy iterator it, the useful binary distinction is

[issue28258] Broken python-config generated with Estonian locale

2016-09-29 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- assignee: twouters -> serhiy.storchaka resolution: -> fixed stage: -> resolved status: open -> closed type: -> compile error versions: +Python 2.7 ___ Python tracker

[issue28258] Broken python-config generated with Estonian locale

2016-09-29 Thread Roundup Robot
Roundup Robot added the comment: New changeset 6110997dd6e7 by Serhiy Storchaka in branch '3.5': Issue #28258: Fixed build with Estonian locale (python-config and distclean https://hg.python.org/cpython/rev/6110997dd6e7 New changeset 1b9e71f5de83 by Serhiy Storchaka in branch '3.6': Issue

[issue28289] ImportError.__init__ doesn't reset not specified exception attributes

2016-09-29 Thread Roundup Robot
Roundup Robot added the comment: New changeset dcb39d3ba67a by Serhiy Storchaka in branch 'default': Issue #28289: ImportError.__init__ now resets not specified attributes. https://hg.python.org/cpython/rev/dcb39d3ba67a -- nosy: +python-dev ___

[issue28278] Make `weakref.WeakKeyDictionary.__repr__` meaningful

2016-09-29 Thread Fred L. Drake, Jr.
Fred L. Drake, Jr. added the comment: I don't recall that the issues discussed here were considered when these classes were added; functionality was the issue at the time. I'm not particularly opposed to adding a more data-ful repr for the weakref-oriented mappings, but I'm not really

[issue28201] dict: perturb shift should be done when first conflict

2016-09-29 Thread INADA Naoki
INADA Naoki added the comment: Could anyone review the patch? I'm starting to #28199. But it must conflict with this patch. -- assignee: -> inada.naoki ___ Python tracker

Re: Expression can be simplified on list

2016-09-29 Thread MRAB
On 2016-09-29 09:14, Steven D'Aprano wrote: On Thursday 29 September 2016 16:47, Rustom Mody wrote: On Thursday, September 15, 2016 at 1:43:05 AM UTC+5:30, Terry Reedy wrote: [...] Python make no such nonsense claim. By default, Python objects are truthy. >>> bool(object()) True Because

Re: Expression can be simplified on list

2016-09-29 Thread Chris Angelico
On Fri, Sep 30, 2016 at 2:36 AM, MRAB wrote: > On 2016-09-29 16:56, Steve D'Aprano wrote: >> >> On Thu, 29 Sep 2016 09:53 pm, MRAB wrote: >> >>> What if an _exhausted_ iterator was falsey? >> >> >> >> The problem is that in general you can't tell if an iterator is

Re: Expression can be simplified on list

2016-09-29 Thread MRAB
On 2016-09-29 16:56, Steve D'Aprano wrote: On Thu, 29 Sep 2016 09:53 pm, MRAB wrote: What if an _exhausted_ iterator was falsey? The problem is that in general you can't tell if an iterator is exhausted until you attempt to advance it. So even if bool(iterator) returns True, the call to

[issue28298] can't set big int-like objects to items in array 'Q', 'L' and 'I'

2016-09-29 Thread Mark Dickinson
Mark Dickinson added the comment: > and got a 'TypeError: an integer is required (got type LikeInt)' Right, see #12974 for more on arrays, `__int__` and `__index__`. -- ___ Python tracker

Re: Expression can be simplified on list

2016-09-29 Thread Steve D'Aprano
On Thu, 29 Sep 2016 09:53 pm, MRAB wrote: > What if an _exhausted_ iterator was falsey? The problem is that in general you can't tell if an iterator is exhausted until you attempt to advance it. So even if bool(iterator) returns True, the call to next() may raise StopIteration: def gen():

Abusive Italian Spam

2016-09-29 Thread Tim Golden
You may have noticed one or two more of the abusive spam messages slip through onto the list. We do have traps for these but, as with most such things, they need tuning. (We've discarded many more than you've seen). As ever, kudos to Mark Sapiro of the Mailman team for tweaking our custom filters

[issue28313] ttk Style().configure() overwrites Tk().option_add() Button but not Label

2016-09-29 Thread qubodup
New submission from qubodup: The following code will result in a small label and a big button: from tkinter import * from tkinter.ttk import * root = Tk() root.option_add("*Font", "sans-serif 12") s = Style() s.configure('TButton', font=('courier', 40)) s.configure('TLabel', font=('courier',

SOAP XML webserver in Python/Django

2016-09-29 Thread ivan77
Hi All, I currently have a need to setup a webserver on one of our internal servers that is going to send and receive XML SOAP responses to an external company through a VPN. It seems like something that I could use python (maybe even Django) for. However, even though I have been using

ANN: dedent 0.5 released

2016-09-29 Thread Christian Tismer
Dedent 0.5 == What is it? --- Dedent is a very simple tool for those people who like to indent their inline code nicely. For those who got already what it is, stop reading. :-) All the others: What is it, really? --- Ok, think of some inline Python code,

ANN: dedent 0.5 released

2016-09-29 Thread Christian Tismer
Dedent 0.5 == What is it? --- Dedent is a very simple tool for those people who like to indent their inline code nicely. For those who got already what it is, stop reading. :-) All the others: What is it, really? --- Ok, think of some inline Python code,

[issue28294] HTTPServer server.py assumes sys.stderr != None

2016-09-29 Thread Mariatta Wijaya
Mariatta Wijaya added the comment: I'm interested to work on a patch for this, if no one started yet. -- ___ Python tracker ___

Re: Using the Windows "embedded" distribution of Python

2016-09-29 Thread Paul Moore
On Thursday, 29 September 2016 12:56:28 UTC+1, eryk sun wrote: >> Oh, wow. Now you mention it, I recall that convention (from somewhere). >> >> I'll investigate that option (although it may not suit my use case, as >> I want multiple exes in the one "main" directory sharing a single >> "local"

[issue27942] Default value identity regression

2016-09-29 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- assignee: -> serhiy.storchaka ___ Python tracker ___

[issue28298] can't set big int-like objects to items in array 'Q', 'L' and 'I'

2016-09-29 Thread Oren Milman
Oren Milman added the comment: You are right about the terminology of course. My bad. Anyway, the bug is not related to __index__ (or nb_index), because the three aforementioned functions are using (in case '!PyLong_Check(v)') PyArg_Parse with the formats 'l' or 'L'. Ultimately, convertsimple

[issue28307] Accelerate 'string' % (value, ...) by using formatted string literals

2016-09-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thanks for the correction Antti. Yes, this is what I initially meant. This optimization is applicable only if the left argument of % is a literal string and the right argument is a tuple expression. Saying about `'%s' % x` I meant a component of the tuple.

problemes

2016-09-29 Thread Lidia ARNAL
bonjour je n'arrive plus a me connecter au script doA-Tools alors que celui si fonctionnait bien. la fenêtre reste noir et rien ne se passe  merci de votre aide   -- https://mail.python.org/mailman/listinfo/python-list

Re: Expression can be simplified on list

2016-09-29 Thread Peter Otten
MRAB wrote: > What if an _exhausted_ iterator was falsey? Many would expect it = iter("abc") while it: print(next(it)) to work (i. e. no StopIteration) -- if it doesn't, what's the actual usecase? If it does work there must be some lookahead which not all iterators can provide in a

[issue28307] Accelerate 'string' % (value, ...) by using formatted string literals

2016-09-29 Thread Antti Haapala
Antti Haapala added the comment: Serhiy, you actually did make a mistake above; `'%s' % x` cannot be rewritten as `f'{x!s}'`, only `'%s' % (x,)` can be optimized... (just try with `x = 1, 2`) -- nosy: +ztane ___ Python tracker

Re: Using the Windows "embedded" distribution of Python

2016-09-29 Thread eryk sun
On Thu, Sep 29, 2016 at 10:41 AM, Paul Moore wrote: > On Thursday, 29 September 2016 10:39:10 UTC+1, eryk sun wrote: >> On Thu, Sep 29, 2016 at 8:35 AM, Paul Moore wrote: >> > PS It's a shame there's no way to put the embedded distribution in a >> >

Re: Expression can be simplified on list

2016-09-29 Thread MRAB
On 2016-09-29 10:49, Steven D'Aprano wrote: On Thursday 29 September 2016 18:45, Jussi Piitulainen wrote: [snip] What do you say about things like iterators and generators? I'd say they are containers, but they count as true even when they are empty. No, they aren't containers, because they

Re: how to automate java application in window using python

2016-09-29 Thread Ned Batchelder
On Wednesday, September 28, 2016 at 8:00:09 PM UTC-4, Lawrence D’Oliveiro wrote: > On Thursday, September 29, 2016 at 11:54:46 AM UTC+13, Emile van Sebille > wrote: > > Which worked for me! You should try it. Sloppy programming has always > > been unreliable. > > So it is clear you don’t have

[issue28183] Clean up and speed up dict iteration

2016-09-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Please wait until I merge my changes. -- ___ Python tracker ___ ___

Re: Using the Windows "embedded" distribution of Python

2016-09-29 Thread Paul Moore
On Thursday, 29 September 2016 10:39:10 UTC+1, eryk sun wrote: > On Thu, Sep 29, 2016 at 8:35 AM, Paul Moore wrote: > > PS It's a shame there's no way to put the embedded distribution in a > > subdirectory > > *without* needing to use dynamic loading, but I guess that's

[issue28307] Accelerate 'string' % (value, ...) by using formatted string literals

2016-09-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: '%s' % x should be translated to f'{x!s}', not to f'{x:s}'. Only %s, %r and %a can be supported. Formatting with %i should left untranslated. Or maybe translate '%r: %i' % (a, x) to f'{a!r}: {"%i" % x}'. It is possible also to introduce special opcodes that

[issue28183] Clean up and speed up dict iteration

2016-09-29 Thread STINNER Victor
STINNER Victor added the comment: dict_iter7.patch LGTM, go ahead. Just dont forget to mention Serhiy Storchaka as the co-author ;-) -- ___ Python tracker

[issue28310] Mixing yield and return with value is allowed

2016-09-29 Thread STINNER Victor
STINNER Victor added the comment: > The return value is ignored and an empty generator is produced. It's not ignored: it is passed in the argument of the StopIterator object. > You can read https://www.python.org/dev/peps/pep-0380 for the entire story. See also the PEP 479 (Change

[issue28277] ./Modules/_io/_iomodule.c build failure on AIX (beta1) while (a2) was fine.

2016-09-29 Thread Michael Felt
Michael Felt added the comment: yes. It is what I did manually. Thanks! -- ___ Python tracker ___ ___

[issue28310] Mixing yield and return with value is allowed

2016-09-29 Thread Xiang Zhang
Xiang Zhang added the comment: `return value` is allowed in a generator to support `yield from'. You can read https://www.python.org/dev/peps/pep-0380 for the entire story. -- nosy: +xiang.zhang resolution: -> not a bug stage: -> resolved status: open -> closed

[issue28312] Minor change - more direct hint re: multiple machine sizes and LONG_BIT conflicts

2016-09-29 Thread Michael Felt
New submission from Michael Felt: I have been trying to build (pip install) mercurial - for ages. I kept running into this message: "/opt/include/python2.7/pyport.h", line 887.2: 1506-205 (S) #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)." And - finally,

Re: Expression can be simplified on list

2016-09-29 Thread Steven D'Aprano
On Thursday 29 September 2016 18:45, Jussi Piitulainen wrote: > Steven D'Aprano writes: > > [- -] > >> What is this truthiness abstraction? It is the difference between >> "something" and "nothing". >> >> Values which represent nothing, e.g.: >> >> - None >> - numeric zero: 0, 0.0, 0j,

[issue28307] Accelerate 'string' % (value, ...) by using formatted string literals

2016-09-29 Thread Eric V. Smith
Eric V. Smith added the comment: There isn't a direct mapping between %-formatting and __format__ format specifiers. Off the top of my head, I can think of at least one difference: >>> '%i' % 3 '3' >>> '{:i}'.format(3) Traceback (most recent call last): File "", line 1, in ValueError:

Re: Using the Windows "embedded" distribution of Python

2016-09-29 Thread eryk sun
On Thu, Sep 29, 2016 at 8:35 AM, Paul Moore wrote: > PS It's a shame there's no way to put the embedded distribution in a > subdirectory > *without* needing to use dynamic loading, but I guess that's basically an OS > limitation. There are ways to do this. The simplest

Re: Expression can be simplified on list

2016-09-29 Thread Lawrence D’Oliveiro
On Thursday, September 29, 2016 at 7:48:41 PM UTC+13, Rustom Mody wrote: > - And then uses a value of that type in a non-trivial bool-consuming position > such as the condition of an if/while etc > > There's a very good chance that bool-usage is buggy  --

[issue28183] Clean up and speed up dict iteration

2016-09-29 Thread INADA Naoki
Changes by INADA Naoki : Added file: http://bugs.python.org/file44879/dict_iter7.patch ___ Python tracker ___

Re: Is there a way to change the closure of a python function?

2016-09-29 Thread Lawrence D’Oliveiro
On Thursday, September 29, 2016 at 7:13:15 PM UTC+13, Gregory Ewing wrote: > Philosophical question: Is a function that never > returns actually a function? Denotational semantics calls that value “bottom”. -- https://mail.python.org/mailman/listinfo/python-list

Re: Expression can be simplified on list

2016-09-29 Thread Chris Angelico
On Thu, Sep 29, 2016 at 6:45 PM, Jussi Piitulainen wrote: > What do you say about things like iterators and generators? I'd say they > are containers, but they count as true even when they are empty. > > bool(x for x in [3,1] if x in [2,7]) # True > list(x for x in

[issue28308] Accelerate 'string'.format(value, ...) by using formatted string literals

2016-09-29 Thread Eric V. Smith
Eric V. Smith added the comment: One thing to be careful of here is that there's one slight difference between how str.format() and f-strings handle indexing of values. f-strings, of course, use normal Python semantics, but str.format() treats indexing by things that don't look like integers

[issue28311] AIX shared library extension modules installation broken - Python2.7

2016-09-29 Thread Michael Felt
Changes by Michael Felt : -- type: compile error -> behavior ___ Python tracker ___ ___

[issue28311] AIX shared library extension modules installation broken - Python2.7

2016-09-29 Thread Michael Felt
Changes by Michael Felt : -- type: -> compile error ___ Python tracker ___ ___

  1   2   >