[issue12029] Catching virtual subclasses in except clauses

2015-10-21 Thread R. David Murray
R. David Murray added the comment: Note from discussion on duplicate issue 25448: when this is fixed, the try/except documentation should be updated to indicate that the except clause test is equivalent to 'issubclass', so that the handling of virtual subclasses are implied by the doc. (The

[issue25453] Arithmetics with complex infinities is inconsistent with C/C++

2015-10-21 Thread Steven D'Aprano
Steven D'Aprano added the comment: I'm not entirely satisfied that the way it is calculated by C++11/C99 is correct. (Although I can see the appeal of the C version.) Mathematically, complex multiplication (a+bj)*x should be identical to (a+bj)*(x+0j), but obviously in the presence of NANs

PyPi bug?

2015-10-21 Thread Nagy László Zsolt
Today I have tried to register and upload a new package by executing setup.py register I was asked if I want to save the creditentials in a .pypirc file and I answered yes. Next I wanted to run setup.py upload and I got this error: Traceback (most recent call last): File

[issue25453] Arithmetics with complex infinities is inconsistent with C/C++

2015-10-21 Thread Francesco Biscani
Francesco Biscani added the comment: The best reference I could find so far is in the C99 standard: http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf Annex G is titled "IEC 60559-compatible complex arithmetic". In G.3.1 it is written: """ A complex or imaginary value with at least

[issue24379] operator.subscript

2015-10-21 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- priority: normal -> high ___ Python tracker ___

[issue25210] Special-case NoneType() in do_richcompare()

2015-10-21 Thread Roundup Robot
Roundup Robot added the comment: New changeset 5c7dd88cd0c5 by Berker Peksag in branch 'default': Issue #25210: Add some basic tests for the new exception message https://hg.python.org/cpython/rev/5c7dd88cd0c5 -- ___ Python tracker

[issue25453] Arithmetics with complex infinities is inconsistent with C/C++

2015-10-21 Thread Eric V. Smith
Eric V. Smith added the comment: Saksham: Also, it would be best to take this discussion of how to produce a patch to the python-committers mailing list: https://mail.python.org/mailman/listinfo/python-committers -- ___ Python tracker

[issue25449] Test OrderedDict subclass

2015-10-21 Thread Eric Snow
Eric Snow added the comment: Regarding dict.__setitem__, see issue #24726. Raymond outlined what needs to be fixed. -- ___ Python tracker ___

[issue25453] Arithmetics with complex infinities is inconsistent with C/C++

2015-10-21 Thread Saksham Agrawal
Saksham Agrawal added the comment: I read the first 6 chapters of the devguide. Now how should I proceed. -- ___ Python tracker ___

[issue24379] operator.subscript

2015-10-21 Thread Raymond Hettinger
Raymond Hettinger added the comment: This is causing a reference leak problem: https://mail.python.org/pipermail/python-dev/2015-October/141993.html -- resolution: fixed -> status: closed -> open ___ Python tracker

[issue25449] Test OrderedDict subclass

2015-10-21 Thread Eric Snow
Changes by Eric Snow : -- stage: commit review -> patch review ___ Python tracker ___

[issue24726] OrderedDict has strange behaviour when dict.__setitem__ is used.

2015-10-21 Thread Eric Snow
Eric Snow added the comment: FTR, this will likely involve more than just fixing odict_repr(). -- ___ Python tracker ___

[issue24726] OrderedDict has strange behaviour when dict.__setitem__ is used.

2015-10-21 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +serhiy.storchaka ___ Python tracker ___ ___

Re: 2.7.9: PhotoImage get/put

2015-10-21 Thread Randy Day
In article , tjre...@udel.edu says... [snip] > > I made my 'root' Tk instance global, and > > call root.update_idletasks() after the > > .put > I did not see the original post, but the alternative way to animate is > to use

[issue25453] Arithmetics with complex infinities is inconsistent with C/C++

2015-10-21 Thread Eric V. Smith
Eric V. Smith added the comment: Saksham: First we need our "experts" to decide what, if any, change is needed. If we decide that a change is needed, at that point we'd look at a patch. -- ___ Python tracker

[issue25453] Arithmetics with complex infinities is inconsistent with C/C++

2015-10-21 Thread Berker Peksag
Berker Peksag added the comment: > Also, it would be best to take this discussion of how to produce a patch to > the python-committers mailing list: or the core-mentorship list: https://mail.python.org/mailman/listinfo/core-mentorship :) -- nosy: +berker.peksag

If one IF is satisfied, skip the rest in the nest...

2015-10-21 Thread bigred04bd3
So here what I have, I have a 3 IF's within the same level. If one IF is satisfied, I would like to "skip" the other IFs and continue with my code. # 4 second open if wb1_sheet1.cell(row=cell + 1, column=2).value == 0 and wb1_sheet1.cell(row=cell + 1, column=3).value == 0 and

[issue20504] cgi.FieldStorage, multipart, missing Content-Length

2015-10-21 Thread Berker Peksag
Berker Peksag added the comment: The attached patch(cgi.patch) doesn't fix the problem for me: cgi-bug.py still fails with a TypeError. Here is a patch with a test to fix the problem. With issue20504.diff applied: $ ./python t.py 5 (Only changed the "assert len(fields["my-arg"].file.read())

Re: If one IF is satisfied, skip the rest in the nest...

2015-10-21 Thread John Gordon
In <50a6789a-3965-430b-9a91-b08adcedf...@googlegroups.com> bigred04...@gmail.com writes: > So here what I have, I have a 3 IF's within the same level. If one IF is s= > atisfied, I would like to "skip" the other IFs and continue with my code. > # 4 second open > if

Re: If one IF is satisfied, skip the rest in the nest...

2015-10-21 Thread bigred04bd3
O...MG I cannot believe I just asked this question ha. I ended up realizing I need to use an elif after I took a break from it and re read everything...Brain fart, thanks for replies. Brice -- https://mail.python.org/mailman/listinfo/python-list

[issue25417] Minor typo in Path.samefile docstring

2015-10-21 Thread Berker Peksag
Berker Peksag added the comment: Fixed, thank you Antony. -- nosy: +berker.peksag resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker

[issue25453] Arithmetics with complex infinities is inconsistent with C/C++

2015-10-21 Thread Mark Dickinson
Changes by Mark Dickinson : -- nosy: +tim.peters ___ Python tracker ___ ___

[issue25417] Minor typo in Path.samefile docstring

2015-10-21 Thread Antony Lee
Antony Lee added the comment: Actually there's also an extra dot at the end of the first line of the docstring (redundant with the one on the second line). -- ___ Python tracker

[issue25453] Arithmetics with complex infinities is inconsistent with C/C++

2015-10-21 Thread Eric V. Smith
Eric V. Smith added the comment: > Berker Peksag added the comment: > >> Also, it would be best to take this discussion of how to produce a patch to >> the python-committers mailing list: > > or the core-mentorship list: > https://mail.python.org/mailman/listinfo/core-mentorship :) Argh!

[issue25453] Arithmetics with complex infinities is inconsistent with C/C++

2015-10-21 Thread Mark Dickinson
Mark Dickinson added the comment: Changing Python versions and issue type: the current behaviour is certainly deliberate, so a proposal to change it would be a feature request, which could only land in Python 3.6 or later. -- type: behavior -> enhancement versions: -Python 2.7,

Re: How to rearrange array using Python?

2015-10-21 Thread Martin Schöön
Den 2015-10-20 skrev Ian Kelly : >> >> Anyone into CSP willing to offer me a hint? > > I assume that your variables are the individuals and the domains of > those variables are the rooms. Based on the python-constraint docs, > your constraint could look something like this:

[issue25453] Arithmetics with complex infinities is inconsistent with C/C++

2015-10-21 Thread Mark Dickinson
Mark Dickinson added the comment: Thanks for the update. I'm not too worried about performance: I suspect that any additional overhead would be lost in the overhead of the Python machinery. It would be worth profiling to check, of course, before any change went in. I'd expect that most

[issue25417] Minor typo in Path.samefile docstring

2015-10-21 Thread Roundup Robot
Roundup Robot added the comment: New changeset 7d65be20e0d8 by Berker Peksag in branch '3.5': Issue #25417: Fix typo in Path.samefile() docstring https://hg.python.org/cpython/rev/7d65be20e0d8 New changeset 0b09a866da77 by Berker Peksag in branch 'default': Issue #25417: Fix typo in

[issue25449] Test OrderedDict subclass

2015-10-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New patch adds PurePythonOrderedDictSubclassTests, moves all tests except test_key_change_during_iteration from CPythonOrderedDictTests to OrderedDictTests to test Python implementation too, fixes a bug in values and items iteration that caused

[issue25454] operator.methodcaller should accept additional arguments during the call

2015-10-21 Thread Evgeny Kapun
New submission from Evgeny Kapun: Currently, operator.methodcaller behaves like this: def methodcaller(name, *args, **kwargs): def caller(obj): return getattr(obj, name)(*args, **kwargs) return caller That is, it is possible to supply arguments when the object

[issue25453] Arithmetics with complex infinities is inconsistent with C/C++

2015-10-21 Thread Mark Dickinson
Mark Dickinson added the comment: If the proposal is to add C99 Appendix G-style handling of nan+nanj results for complex multiplication, that doesn't seem unreasonable to me, though I'm not particularly convinced that the gain in complexity is worth it. So -0 from me. Whatever happens, I'd

A high-level cross-platform API for terminal/console access

2015-10-21 Thread Peter Brittain
I have recently been working on a terminal/console animation package (https://github.com/peterbrittain/asciimatics). Beyond the high-level animation methods/objects it provides, it also needed to be cross-platform and and simple to install with pip (including any dependencies). This

[issue25453] Arithmetics with complex infinities is inconsistent with C/C++

2015-10-21 Thread Francesco Biscani
Francesco Biscani added the comment: Hi Mark, the original code is C++, and the inf + nanj result can be reproduced by the following snippet: """ #include #include int main(int argc, char * argv[]) { std::cout << std::complex(3,0) / 0. << '\n'; return 0; } """ Here is the C99 version:

[issue25455] Some repr implementations don't check for self-referential structures

2015-10-21 Thread Evgeny Kapun
New submission from Evgeny Kapun: Implementations of repr for some of the types in the standard library doesn't check for self-referential structures. As a result, when calling repr() on such objects, Python crashes due to infinite recursion. Example: >>> import functools >>> x =

[issue25450] Python 3.5 starts in C:\Windows\system32 as current directory

2015-10-21 Thread Steve Dower
Changes by Steve Dower : -- assignee: -> steve.dower ___ Python tracker ___ ___

Re: If one IF is satisfied, skip the rest in the nest...

2015-10-21 Thread Denis McMahon
On Wed, 21 Oct 2015 10:31:04 -0700, bigred04bd3 wrote: > So here what I have, I have a 3 IF's within the same level. If one IF > is satisfied, I would like to "skip" the other IFs and continue with my > code. c1 = wb1_sheet1.cell(row=cell + 1, column=2).value == 0 and

Re: If one IF is satisfied, skip the rest in the nest...

2015-10-21 Thread Grant Edwards
On 2015-10-21, Denis McMahon wrote: > On Wed, 21 Oct 2015 10:31:04 -0700, bigred04bd3 wrote: > >> So here what I have, I have a 3 IF's within the same level. If one IF >> is satisfied, I would like to "skip" the other IFs and continue with my >> code. > > c1 =

[issue24726] OrderedDict has strange behaviour when dict.__setitem__ is used.

2015-10-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: __repr__() allocates a list with the size len(od) and fills it iterating linked list. If the size of linked list is less then the size of the dict, the rest of the list is not initialized. Even worse things happened when the size of linked list is greater

Re: A high-level cross-platform API for terminal/console access

2015-10-21 Thread Laura Creighton
In a message of Wed, 21 Oct 2015 11:30:25 -0700, Peter Brittain writes: >I have recently been working on a terminal/console animation package >(https://github.com/peterbrittain/asciimatics). Beyond the high-level >animation methods/objects it provides, it also needed to be cross-platform and

Re: A high-level cross-platform API for terminal/console access

2015-10-21 Thread eryksun
On 10/21/15, Peter Brittain wrote: >> >> Did you try https://pypi.python.org/pypi/UniCurses ? >> > > Yes - it failed to install with pip and also looked like a dead project when > I followed the project home page URL. > -- >

Re: A high-level cross-platform API for terminal/console access

2015-10-21 Thread Peter Brittain
> > Did you try https://pypi.python.org/pypi/UniCurses ? > Yes - it failed to install with pip and also looked like a dead project when I followed the project home page URL. -- https://mail.python.org/mailman/listinfo/python-list

[issue24782] Merge 'configure extensions' into main IDLE config dialog

2015-10-21 Thread Mark Roseman
Mark Roseman added the comment: The extra width appears to be coming from the canvas inside VerticalScrolledFrame; the canvas gets the default size and the frame adjusts to fit its contents (the canvas and the scrollbar). If you really want to reduce the size, add a "-width" option where that

Re: If one IF is satisfied, skip the rest in the nest...

2015-10-21 Thread Denis McMahon
On Wed, 21 Oct 2015 20:07:21 +, Grant Edwards wrote: > On 2015-10-21, Denis McMahon wrote: >> On Wed, 21 Oct 2015 10:31:04 -0700, bigred04bd3 wrote: >> >>> So here what I have, I have a 3 IF's within the same level. If one IF >>> is satisfied, I would like to

Re: If one IF is satisfied, skip the rest in the nest...

2015-10-21 Thread Ian Kelly
On Wed, Oct 21, 2015 at 11:31 AM, wrote: > So here what I have, I have a 3 IF's within the same level. If one IF is > satisfied, I would like to "skip" the other IFs and continue with my code. I think you're looking for the elif keyword. An elif branch will only be

select.poll and ppoll

2015-10-21 Thread Steven D'Aprano
Using Python 2.6, don't hate me. I have select.poll, but I'm looking for something like ppoll instead. From the Linux man page: ppoll() The relationship between poll() and ppoll() is analogous to the relationship between select(2) and pselect(2): like pselect(2),

[issue25417] Minor typo in Path.samefile docstring

2015-10-21 Thread Roundup Robot
Roundup Robot added the comment: New changeset 642a7be9f384 by Berker Peksag in branch '3.5': Issue #25417: Remove the extra dot from docstring https://hg.python.org/cpython/rev/642a7be9f384 New changeset 4cd2ae001d30 by Berker Peksag in branch 'default': Issue #25417: Remove the extra dot from

Re: variable scope of class objects

2015-10-21 Thread JonRob
@Dennis, Thanks for your example. My structure is very similar. Perhaps I was reading too much into Luca's below statement regarding declaring variables. Regards, JonRob Luca wrote... >Please, note that declaring a variable in the constructor is only a >convention: in Python you can

[issue23981] Update test_unicodedata.py to use script_helpers

2015-10-21 Thread Roundup Robot
Roundup Robot added the comment: New changeset fbd83224e132 by Berker Peksag in branch '3.5': Issue #23981: Update test_unicodedata to use script_helpers https://hg.python.org/cpython/rev/fbd83224e132 New changeset 6315abbf5f71 by Berker Peksag in branch 'default': Issue #23981: Update

[issue23981] Update test_unicodedata.py to use script_helpers

2015-10-21 Thread Berker Peksag
Berker Peksag added the comment: Thanks for the patch, Christie. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue25017] htmllib deprecated: Which library to use? Missing sane default in docs

2015-10-21 Thread Nan Wu
Nan Wu added the comment: Updated the patch. The typo was fixed too. Thanks for the catching. -- Added file: http://bugs.python.org/file40831/htmllib_deprecation_warning_2.patch ___ Python tracker

[issue25453] Arithmetics with complex infinities is inconsistent with C/C++

2015-10-21 Thread Ezio Melotti
Ezio Melotti added the comment: Saksham, if you would like to work on this issue you can check the devguide for more information. -- components: +Interpreter Core nosy: +eric.smith, ezio.melotti, lemburg, mark.dickinson, stutzbach versions: +Python 3.4, Python 3.5, Python 3.6 -Python

[issue25446] smtplib.py AUTH LOGIN code messed up sending login and password data since 3.5

2015-10-21 Thread R. David Murray
R. David Murray added the comment: Thanks, but special-casing login in the 'auth' method means that the auth method isn't working right, since special-casing defeats the whole purpose of the auth mechanism. I think we need to change the logic in auth so that it is checking for a 334 even if

Re: Defamation

2015-10-21 Thread Laura Creighton
In a message of Wed, 21 Oct 2015 10:30:35 +1100, "Steven D'Aprano" writes: >On Wed, 21 Oct 2015 01:44 am, Laura Creighton wrote: >> No, we are removing them because we want to. > >Who are "we"? You're not talking about *you and me*. Anybody who was involved in deciding whether or not to remove

[issue14373] C implementation of functools.lru_cache

2015-10-21 Thread Matt Joiner
Changes by Matt Joiner : -- nosy: -anacrolix ___ Python tracker ___ ___

[issue25452] Add __bool__() method to subprocess.CompletedProcess

2015-10-21 Thread Richard Neumann
New submission from Richard Neumann: The class subprocess.CompletedProcess is currently lacking a __bool__() method. It might be a practical feature to have the possibility to evaluate a CompletedProcess instance in an if/else block without the necessity to handle the exception raised by

Re: Defamation

2015-10-21 Thread Ralf Hildebrandt
> According to Ralf, python.org is hosted in the Netherlands, One could change that. > I want to buy peanut butter, but I don't, because I know that when it comes > to peanut butter I have no self-control and would eat the entire jar in a > single sitting. So I simply don't buy it in the first

[issue25453] Arithmetics with complex infinities is inconsistent with C/C++

2015-10-21 Thread Francesco Biscani
New submission from Francesco Biscani: The C++11/C99 standards define a complex infinity as a complex number in which at least one of the components is inf. Consider the Python snippet: >>> complex(float('inf'),float('nan'))*2 (nan+nanj) This happens because complex multiplication in Python

[issue25453] Arithmetics with complex infinities is inconsistent with C/C++

2015-10-21 Thread Saksham Agrawal
Saksham Agrawal added the comment: Hi Would like to work on this bug...but I am new, would like some guidance Please help me -- nosy: +Saksham Agrawal ___ Python tracker

Re: 2.7.9: PhotoImage get/put

2015-10-21 Thread Randy Day
In article , illusiontechniq...@gmail.com says... [snip] > If you want to pass arguments to a command called when a button is > clicked, you have to use 'lambda' in tkinter. Thanks. I just skimmed over lambda before now... > You can't expect

Re: 2.7.9: PhotoImage get/put

2015-10-21 Thread Randy Day
In article , em...@fenx.com says... [snip] > I have no idea why, but here are some ideas I'd try out. > So is it refreshing upon completion of the loop, or upon exit from > process()? It turns out I need to call root.update_idletasks() for

Re: What does it mean for Python to have “constants”?

2015-10-21 Thread Nagy László Zsolt
Dennis Lee Bieber writes: >> (Python does not have anything that one might consider a true constant >> -- other than the language defined singletons: None, and maybe by now >> True and False). > Python now deals with those by making the names keywords:: > > >>> True =

[issue25449] Test OrderedDict subclass

2015-10-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The patch was not ready for commit. The problem is that test_issue24347 fails in CPythonOrderedDictSubclassTests. The failure is random, you need to run test several times to encounter it. Experimenting with this test I found other bug probably related to

[issue25450] Python 3.5 starts in C:\Windows\system32 as current directory

2015-10-21 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- title: IDLE: Save path automatically choses C:\Windows\system32 -> Python 3.5 starts in C:\Windows\system32 as current directory versions: +Python 3.6 ___ Python tracker

Re: 2.7.9: PhotoImage get/put

2015-10-21 Thread Terry Reedy
On 10/21/2015 1:50 AM, Randy Day wrote: When I read your post, I realized I'm doing a crude animation. After a bit of searching on 'python canvas animation', I found a reference to how it's done: I made my 'root' Tk instance global, and call root.update_idletasks() after the .put I did not

[issue25450] Python 3.5 starts in C:\Windows\system32 as current directory

2015-10-21 Thread eryksun
eryksun added the comment: > 'Start in:' is blank and for what ever reason, the default is ...system32. When the "Start in" field of a .lnk shortcut is blank, the child process inherits the working directory of the parent process (i.e. the process that runs the shortcut), unless the parent

[issue25450] Python 3.5 starts in C:\Windows\system32 as current directory

2015-10-21 Thread Terry J. Reedy
Terry J. Reedy added the comment: Thanks for the explanation. When I did the test with Command Prompt, I happened to be in /Users/Terry, which is where C.P. starts. %USERPROFILE% is what I was thinking of but could not precisely remember. It worked when put in that box. I think adding

[issue25017] htmllib deprecated: Which library to use? Missing sane default in docs

2015-10-21 Thread Martin Panter
Martin Panter added the comment: Also beware it should be :mod: not :mode: :) -- ___ Python tracker ___ ___

Re: Defamation

2015-10-21 Thread Terry Reedy
On 10/21/2015 2:53 AM, Laura Creighton wrote: In a message of Wed, 21 Oct 2015 10:30:35 +1100, "Steven D'Aprano" writes: On Wed, 21 Oct 2015 01:44 am, Laura Creighton wrote: No, we are removing them because we want to. Who are "we"? You're not talking about *you and me*. Anybody who was

[issue25451] PhotoImage transparency methods

2015-10-21 Thread None Becoming
New submission from None Becoming: The transparency methods of tkinter.PhotoImage seem to be missing. Presumably, they would go something like: def transparency_get(self, x, y): """Returns a boolean indicating if the pixel at (x,y) is transparent. """ return self.tk.call(self.name,