[issue27378] remove ref to Phil Schwartz's 'Kodos' in regex HOWTO

2016-06-23 Thread Berker Peksag
Berker Peksag added the comment: Thanks! -- nosy: +berker.peksag resolution: -> fixed stage: -> resolved status: open -> closed versions: -Python 2.7, Python 3.2, Python 3.3, Python 3.4 ___ Python tracker

[issue27378] remove ref to Phil Schwartz's 'Kodos' in regex HOWTO

2016-06-23 Thread Roundup Robot
Roundup Robot added the comment: New changeset 23182404a85c by Berker Peksag in branch '3.5': Issue #27378: Remove an outdated reference from regex HOWTO https://hg.python.org/cpython/rev/23182404a85c New changeset 21cb299a9626 by Berker Peksag in branch 'default': Issue #27378: Merge from 3.5

[issue27364] Deprecate invalid unicode escape sequences

2016-06-23 Thread Emanuel Barry
Emanuel Barry added the comment: I found the cause of the failed assertion, an invalid escape sequence slipped through in a file. Patch attached (also with Serhiy's comments). It worries me a little though that pure Python code can cause a hard crash. Ok, it worries me a lot. Please don't

[issue27371] Runaway memory consumption using tkinter update()

2016-06-23 Thread Jeremy Blow
Jeremy Blow added the comment: Confirmed the problem is with Tk/MacOS. Running a simple TCL script yielded the same behavior in terms of memory. The hunt goes elsewhere... Thank you R. David for the suggestion. ``` package require Tk while 1 { update } ``` # MacOS 10.9.4 /Users/jeremy$

[issue27364] Deprecate invalid unicode escape sequences

2016-06-23 Thread Emanuel Barry
Emanuel Barry added the comment: Thanks, didn't find that one. Apparently Guido's stance is "Make this a silent warning, then we can discuss about preventing it later", which happens to be what I'm doing here. -- ___ Python tracker

[issue27364] Deprecate invalid unicode escape sequences

2016-06-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: There was a long discussion on Python-Dev. [1] Guido taken part in it. [1] http://comments.gmane.org/gmane.comp.python.devel/151612 -- nosy: +serhiy.storchaka ___ Python tracker

[issue27380] IDLE: add base Query dialog with ttk widgets

2016-06-23 Thread Terry J. Reedy
New submission from Terry J. Reedy: The custom popup entry dialogs in config_sec and config_help have a common structure and overlapping code. When one hits OK and the entry is not valid, both display a specific message and let the user edit the entry (or Cancel). File => Load Module, on the

[issue27364] Deprecate invalid unicode escape sequences

2016-06-23 Thread Emanuel Barry
Emanuel Barry added the comment: Yes, it's in use in an awful lot of places (see my patch). The proper fix is to use raw strings, or, if you need actual escapes in the same string, manually escape them. However, as you'll see by looking at the patch, the vast majority of cases are fixed by

[issue20842] pkgutil docs should reference glossary terms not PEP 302

2016-06-23 Thread Martin Panter
Martin Panter added the comment: See also Issue 26896. Apparently some of the terms you are linking are used wrongly. -- nosy: +martin.panter ___ Python tracker

[issue26537] ConfigParser has optionxform, but not sectionxform

2016-06-23 Thread Xiang Zhang
Xiang Zhang added the comment: ping -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue27377] Add smarter socket.fromfd()

2016-06-23 Thread Martin Panter
Martin Panter added the comment: Maybe if the patch was regenerated with Mercurial off a public revision, it would work with Rietveld. I have seen non-Mercurial patches work too though. Perhaps this one doesn’t because the line numbers are off compared to the default branch? See also Issue

Re: the global keyword:

2016-06-23 Thread eryk sun
On Fri, Jun 24, 2016 at 1:00 AM, Steven D'Aprano wrote: > To be precise, for the builtins module specifically, you can *read* the > value of the variable using just x, but you cannot *assign* to it unless > you use the fully-qualified name builtins.x. FWIW, you can execute

[issue13344] closed sockets don't raise EBADF anymore

2016-06-23 Thread Martin Panter
Martin Panter added the comment: According to strace, Python 3 is calling send(-1, ...): sendto(-1, "x", 1, 0, NULL, 0) = -1 EBADF (Bad file descriptor) A related discrepancy between Python 2 and 3 is how the socket.makefile() objects affect the original socket. In Python 2: >>> f =

Re: the global keyword:

2016-06-23 Thread Chris Angelico
On Fri, Jun 24, 2016 at 11:00 AM, Steven D'Aprano wrote: > To me, a global variable is a variable which is scoped to a level wider than > any single function, i.e. module scope, or whole-application scope. That > is, the variable must be visible to more than one function, or

Re: the global keyword:

2016-06-23 Thread Steven D'Aprano
On Wed, 22 Jun 2016 07:24 pm, BartC wrote: [...] > But even if it worked, I don't think this two-parter counts as a 'global > variable' as it is understood. I might as well just create my own G > module containing: > > BDFL="GvR" > > and import it in both A and B. Then I can also write

Re: Which one is the best JSON parser?

2016-06-23 Thread MRAB
On 2016-06-23 21:58, David Shi via Python-list wrote: Can any one tell me? Regards. David There's one in the standard library. -- https://mail.python.org/mailman/listinfo/python-list

[issue27365] Allow non-ascii chars in IDLE NEWS.txt (for contributor names)

2016-06-23 Thread Roundup Robot
Roundup Robot added the comment: New changeset cbc6407fa393 by Terry Jan Reedy in branch '2.7': Issue #27365: Add blank lines. to 2.7 test_editmenu https://hg.python.org/cpython/rev/cbc6407fa393 -- ___ Python tracker

[issue27371] Runaway memory consumption using tkinter update()

2016-06-23 Thread Jeremy Blow
Jeremy Blow added the comment: That seems like a good idea, will do so and report back findings. Hey, good meeting you at PyCon, by the way. Met you at the freelance open space. :-) -- ___ Python tracker

[issue27371] Runaway memory consumption using tkinter update()

2016-06-23 Thread R. David Murray
R. David Murray added the comment: You might want to try stripping it further, and see if you can reproduce it just using tk, without python involved. -- nosy: +r.david.murray title: Runaway memory consumption using update() -> Runaway memory consumption using tkinter update()

[issue27363] Complex with negative zero imaginary part

2016-06-23 Thread Vedran Čačić
Vedran Čačić added the comment: Funny, I thought the "repr invariant" was exactly the opposite thing, that _eval_ (or literal_eval) of repr should give back the starting object. And that's what I intended to preserve here. It's obviously broken now. Ok, alternate suggestion: can at least

Which one is the best JSON parser?

2016-06-23 Thread David Shi via Python-list
Can any one tell me? Regards. David -- https://mail.python.org/mailman/listinfo/python-list

Which one is the best XML-parser?

2016-06-23 Thread David Shi via Python-list
Which one is the best XML-parser? Can any one tell me? Regards. David -- https://mail.python.org/mailman/listinfo/python-list

Pandas to CSV and .dbf

2016-06-23 Thread David Shi via Python-list
Has anyone tested on Pandas to CSV and .dbf lately? I am looking for proven, tested examples to output Panda Data Frame to CSV and dbf files. Looking forward to hearing from you. Regards. David -- https://mail.python.org/mailman/listinfo/python-list

[issue27376] Add mock_import method to mock module

2016-06-23 Thread SilentGhost
Changes by SilentGhost : -- nosy: +michael.foord stage: -> patch review ___ Python tracker ___

[issue27377] Add smarter socket.fromfd()

2016-06-23 Thread SilentGhost
SilentGhost added the comment: The patch applies cleanly, not sure why the rietveld link doesn't appear. Perhaps because of the extension? In test, I noticed, that you're not testing that OSError is raised, perhaps something to add? -- nosy: +SilentGhost

[issue27375] error in "make test", while trying to install python on linux computer

2016-06-23 Thread Stefan Krah
Changes by Stefan Krah : -- components: +Tests -Build, Installation resolution: fixed -> duplicate status: open -> closed type: compile error -> behavior ___ Python tracker

[issue27378] remove ref to Phil Schwartz's 'Kodos' in regex HOWTO

2016-06-23 Thread Matt Morrison
New submission from Matt Morrison: In the Regular Expressions HOWTO (https://docs.python.org/3/howto/regex.html#performing-matches, Doc/howto/regex.rst), there is the following paragraph: = You can learn about this by interactively experimenting with the :mod:`re` module. If you have

[issue27375] error in "make test", while trying to install python on linux computer

2016-06-23 Thread raphi rose
Changes by raphi rose : -- resolution: -> fixed ___ Python tracker ___ ___

[issue27375] error in "make test", while trying to install python on linux computer

2016-06-23 Thread raphi rose
raphi rose added the comment: ok great, thanks for your help! -- components: +Build, Installation -Tests resolution: duplicate -> status: closed -> open type: behavior -> compile error ___ Python tracker

[issue27377] Add smarter socket.fromfd()

2016-06-23 Thread Neil Schemenauer
Changes by Neil Schemenauer : Removed file: http://bugs.python.org/file43523/fromfd2.txt ___ Python tracker ___

[issue27377] Add smarter socket.fromfd()

2016-06-23 Thread Neil Schemenauer
Neil Schemenauer added the comment: Add documentation for new functions. -- Added file: http://bugs.python.org/file43524/fromfd2.txt ___ Python tracker

[issue27375] error in "make test", while trying to install python on linux computer

2016-06-23 Thread Stefan Krah
Stefan Krah added the comment: Ah, so the tests pass when you run them manually but "make test" fails. This looks like https://bugs.python.org/issue26837 , which is fixed in the next release. You can just ignore this failure, it's harmless. [BTW, using autoremove is fine.] --

[issue27375] error in "make test", while trying to install python on linux computer

2016-06-23 Thread raphi rose
raphi rose added the comment: also, after installing this library liblzma-dev it said that i had redundant files (not in those words) and that I should run "apt-get autoremove," which I did, this may have been what caused the other failures? -- ___

[issue27375] error in "make test", while trying to install python on linux computer

2016-06-23 Thread raphi rose
raphi rose added the comment: the test_ssl rrose@intern:~/temp/Python-3.5.1$ ./python -m test -v test_ssl == CPython 3.5.1 (default, Jun 23 2016, 15:03:20) [GCC 4.8.4] == Linux-3.13.0-88-generic-x86_64-with-debian-jessie-sid little-endian == hash algorithm: siphash24 64bit ==

[issue27375] error in "make test", while trying to install python on linux computer

2016-06-23 Thread raphi rose
raphi rose added the comment: the test_httplib rrose@intern:~/temp/Python-3.5.1$ ./python -m test -v test_httplib == CPython 3.5.1 (default, Jun 23 2016, 15:03:20) [GCC 4.8.4] == Linux-3.13.0-88-generic-x86_64-with-debian-jessie-sid little-endian == hash algorithm: siphash24 64bit ==

[issue27375] error in "make test", while trying to install python on linux computer

2016-06-23 Thread raphi rose
raphi rose added the comment: the test_nntplib rrose@intern:~/temp/Python-3.5.1$ ./python -m test -v test_nntplib == CPython 3.5.1 (default, Jun 23 2016, 15:03:20) [GCC 4.8.4] == Linux-3.13.0-88-generic-x86_64-with-debian-jessie-sid little-endian == hash algorithm: siphash24 64bit ==

[issue27375] error in "make test", while trying to install python on linux computer

2016-06-23 Thread raphi rose
raphi rose added the comment: hmm, well i installed all the ones you told me to, ran make test again, and now it comes up with ERROR: test_article_head_body (test.test_nntplib.NetworkedNNTPTests) -- Traceback (most recent call

Re: Can math.atan2 return INF?

2016-06-23 Thread Ben Bacarisse
alister writes: > On Thu, 23 Jun 2016 15:39:43 +0100, Ben Bacarisse wrote: > >> Steven D'Aprano writes: >> >>> On Thursday 23 June 2016 14:40, Dan Sommers wrote: >>> > Since x == y, the answer should be the same as for any

Re: Setting up Python WinXP

2016-06-23 Thread Joel Goldstick
On Thu, Jun 23, 2016 at 1:11 PM, Michael Smolen <8smo...@tds.net> wrote: > Zach and friends: > I am beginning to learn how to install something like Linux Mint on an old > box from about 2006. That will be my programming machine for Python and > Perl. I can't abandon XP because other projects are

[issue27375] error in "make test", while trying to install python on linux computer

2016-06-23 Thread Stefan Krah
Stefan Krah added the comment: I think you need tcl8.4-dev and tk8.4-dev and perhaps zlib1g-dev. Actually the point is that it's expected that some modules don't build if the corresponding libraries aren't installed. -- ___ Python tracker

[issue20674] Update comments in dictobject.c

2016-06-23 Thread Terry J. Reedy
Terry J. Reedy added the comment: Completely remove all reference to strings as it is normally completely wrong. In three runs of list(map(hash, ("namea", "nameb", "namec", "named"))) I get [-7801965690653662103, -712276634514874737, 4394438508544812081, -6975951345912708912] [-1171799829,

[issue27377] Add smarter socket.fromfd()

2016-06-23 Thread Neil Schemenauer
New submission from Neil Schemenauer: When implementing server software that inherits a socket via a file descriptor, it is useful to be able to query the descriptor and find out what kind of socket has been passed. This can be done with getsockopt() and getsockname(). Python does not

[issue27172] Undeprecate inspect.getfullargspec()

2016-06-23 Thread Nick Coghlan
Nick Coghlan added the comment: OK, as per the above discussion, I've changed the title of this issue to be to undeprecate inspect.getfullargspec(). That change involves two pieces: - change the documented deprecation of inspect.getfullargspec() to instead be a recommendation to avoid using

[issue27172] Add skip_bound_arg argument to inspect.Signature.from_callable()

2016-06-23 Thread Ryan Petrello
Ryan Petrello added the comment: Nick, That seems reasonable to me :) I've updated my library to just use inspect.getfullargspec for Py3. Thanks for taking the time to walk through this with me! -- ___ Python tracker

[issue27375] error in "make test", while trying to install python on linux computer

2016-06-23 Thread raphi rose
raphi rose added the comment: the only one listed as dev was "tcl-snack-dev - Sound extension to Tcl/Tk and Python/Tkinter - development files," or instead of doing that one should i just use "python3-tk - Tkinter - Writing Tk applications with Python 3.x" and put a "-dev" at the end of the

RE: not able to install mysqldb-python

2016-06-23 Thread Joaquin Alzola
>ImportError: No module named 'ConfigParser' It is telling you the error This email is confidential and may be subject to privilege. If you are not the intended recipient, please do not copy or disclose its content but contact the sender immediately upon receipt. --

Re: Break and Continue: While Loops

2016-06-23 Thread John Gordon
In <639b00e0-7b9d-4ed4-96ad-6afbcd536...@googlegroups.com> Elizabeth Weiss writes: > i=0 > while 1==1: >print(i) >i=i+1 >if i>=5: > print("Breaking") > break > Why is Breaking going to be printed if i only goes up to 4? Your code prints i and THEN adds

Re: Can math.atan2 return INF?

2016-06-23 Thread Marko Rauhamaa
pdora...@pas-de-pub-merci.mac.com (Pierre-Alain Dorange): > Steven D'Aprano wrote: >> China has just announced a new supercomputer that is so fast it can >> run an infinite loop in 3.7 seconds. > > Near a black hole 3.7 seconds can last an infinite time... Which phenomenon

Re: Can math.atan2 return INF?

2016-06-23 Thread Pierre-Alain Dorange
Steven D'Aprano wrote: > > which infinity. There are many - some larger than others > > China has just announced a new supercomputer that is so fast it can run an > infinite loop in 3.7 seconds. Near a black hole 3.7 seconds can last an infinite time... -- Pierre-Alain

Re: Setting up Python WinXP

2016-06-23 Thread Michael Smolen
Zach and friends: I am beginning to learn how to install something like Linux Mint on an old box from about 2006. That will be my programming machine for Python and Perl. I can't abandon XP because other projects are in process and my old brain can't handle converting everything at this time.

Re: Can math.atan2 return INF?

2016-06-23 Thread Pierre-Alain Dorange
Dan Sommers wrote: > > Given: > > > > x = INF > > y = INF > > assert x == y > > > > there is a reason to pick atan2(y, x) = pi/4: > > > > Since x == y, the answer should be the same as for any other pair of x == y. > > When x == y == 0, then atan2(y, x) is 0. This is

[issue27376] Add mock_import method to mock module

2016-06-23 Thread Eyal Posener
New submission from Eyal Posener: Add mock_import method. A helper function to mask ``ImportError``s on a scoped code, using the ``with`` statement, or in method a method used as a decorator. Failed imports will be ignored, unless specified by the *do_not_mock* argument. The *do_not_mock*

[issue20842] pkgutil docs should reference glossary terms not PEP 302

2016-06-23 Thread Jaysinh shukla
Jaysinh shukla added the comment: Submitting the patch for this issue. I observed the last message of respected Kushal but because the message was posted too earlier decided to submit patch. Thanks! -- keywords: +patch nosy: +jaysinh.shukla Added file:

Re: Can math.atan2 return INF?

2016-06-23 Thread Steven D'Aprano
On Fri, 24 Jun 2016 01:04 am, alister wrote: > which infinity. There are many - some larger than others China has just announced a new supercomputer that is so fast it can run an infinite loop in 3.7 seconds. -- Steven -- https://mail.python.org/mailman/listinfo/python-list

Re: Operator Precedence/Boolean Logic

2016-06-23 Thread Steven D'Aprano
On Thu, 23 Jun 2016 11:26 pm, Random832 wrote: > On Thu, Jun 23, 2016, at 08:37, Steven D'Aprano wrote: >> You keep saying that, but I've never seen it happen. I've seen cases >> where people have been surprised by the unexpected truthiness of an >> object ("I expected an exhausted iterator to be

[issue27375] error in "make test", while trying to install python on linux computer

2016-06-23 Thread Stefan Krah
Stefan Krah added the comment: You need to install at least these development libraries: sudo apt-get install libssl-dev liblzma-dev libbz2-dev libreadline-dev libgdbm-dev libffi-dev Possibly some are missing in this list, tkinter and zip for example. Use "apt-cache search tkinter" to figure

Re: Guys, can you please share me some sites where we can practice python programs for beginners and Intermediate.

2016-06-23 Thread Cousin Stanley
DFS wrote: > On 6/23/2016 11:11 AM, Cousin Stanley wrote: >> DFS wrote: >> >>> Here's a fun one: scraping data off a website, >>> and storing it in a SQLite database file. >>> >> >> After testing your example code here I found >> that the length of the categories list >> was 1 less

[issue27375] error in "make test", while trying to install python on linux computer

2016-06-23 Thread raphi rose
Changes by raphi rose : -- components: -Tests ___ Python tracker ___ ___

[issue27350] Compact and ordered dict

2016-06-23 Thread INADA Naoki
Changes by INADA Naoki : Added file: http://bugs.python.org/file43520/compact-dict.patch ___ Python tracker ___

[issue27375] error in "make test", while trying to install python on linux computer

2016-06-23 Thread raphi rose
New submission from raphi rose: I am using ubuntu 14.04, and I am trying to install a newer version of python, instead of 2.7.6 I'm trying to use 3.5.1. to do this I downloaded the tar.xz file, extracted it to a directory in my computer (not the /usr/local/bin/). I then went into the terminal

Re: Break and Continue: While Loops

2016-06-23 Thread Chris Angelico
On Fri, Jun 24, 2016 at 1:52 AM, BartC wrote: > On 23/06/2016 12:39, Chris Angelico wrote: >> >> On Thu, Jun 23, 2016 at 8:15 PM, BartC wrote: >>> >>> Actually pretty much any expression can be used, because Python can >>> interpret almost anything as either

[issue27344] zipfile *does* support utf-8 filenames

2016-06-23 Thread Daniel Holth
Daniel Holth added the comment: The documentation should read The ZIP file format supports Unicode filenames. If you have unicode filenames, zipfile will encode them to and from utf-8 internally, but if you pass bytes filenames to write() then they will be stored without a specified encoding.

[issue27364] Deprecate invalid unicode escape sequences

2016-06-23 Thread Antti Haapala
Antti Haapala added the comment: it is handy to be able to use `\w` and `\d` in non-raw-string *regular expressions*, without too much backslashitis. Seems to be in use in Python standard library as well, for example in csv.py -- nosy: +ztane ___

Re: Break and Continue: While Loops

2016-06-23 Thread BartC
On 23/06/2016 12:39, Chris Angelico wrote: On Thu, Jun 23, 2016 at 8:15 PM, BartC wrote: Actually pretty much any expression can be used, because Python can interpret almost anything as either True or False. Don't ask for the rules because they can be complicated, but for

Re: Operator Precedence/Boolean Logic

2016-06-23 Thread Chris Angelico
On Thu, Jun 23, 2016 at 10:37 PM, Steven D'Aprano wrote: > I acknowledge, cheerfully, that there might be a mismatch between what you > expect and what the object actually does. "I expect empty containers to be > falsey, and non-empty ones to be truthy; but this RedBlackTree

[issue27344] zipfile *does* support utf-8 filenames

2016-06-23 Thread Daniel Holth
Daniel Holth added the comment: " ... zipfile will encode them to and from utf-8 internally, and the encoding is marked in a standard flag inside the archive member." -- ___ Python tracker

[issue27344] zipfile *does* support utf-8 filenames

2016-06-23 Thread Daniel Holth
Daniel Holth added the comment: The current documentation says "Note There is no official file name encoding for ZIP files. If you have unicode file names, you must convert them to byte strings in your desired encoding before passing them to write(). WinZip interprets all file names as

[issue27373] logging.handlers.SysLogHandler with TCP not working on rsyslog5.8

2016-06-23 Thread Vinay Sajip
Vinay Sajip added the comment: If it works fine with rsyslog 8.19 but fails with rsyslog 5.8, what exactly is logging doing wrong? How is rsyslog configured in the two cases? How exactly was the fail.log generated (I know you said tcpdump was used, but can you provide more detail)? I'm not

[issue27364] Deprecate invalid unicode escape sequences

2016-06-23 Thread Emanuel Barry
Emanuel Barry added the comment: Now I have! I found nothing on Python-Dev, but apparently it's been discussed on Python-ideas before: https://mail.python.org/pipermail/python-ideas/2015-August/035031.html Guido hasn't participated in that discussion, and most of it was "This will break

[issue27344] zipfile *does* support utf-8 filenames

2016-06-23 Thread R. David Murray
R. David Murray added the comment: OK, what do you propose as a documentation change? The current doc is accurate, but incomplete. New phrasing could include something about the two de-facto standards but that one can not be sure that filenames will be in one of those two encodings. Issue

[issue27374] Cygwin: Makefile does not install DLL import library

2016-06-23 Thread Erik Bray
New submission from Erik Bray: When building Python on Cygwin, both a libpython-X.Y.dll and a libpython-X.Y.dll.a are created (see https://cygwin.com/cygwin-ug-net/dll.html). The latter is an "import library" consisting of stubs for functions in the DLL so that it can be linked to statically

Re: Guys, can you please share me some sites where we can practice python programs for beginners and Intermediate.

2016-06-23 Thread Cousin Stanley
DFS wrote: > Here's a fun one: scraping data off a website, > and storing it in a SQLite database file. > After testing your example code here I found that the length of the categories list was 1 less than the terms list after applying dropwords in the terms list

Re: Can math.atan2 return INF?

2016-06-23 Thread alister
On Thu, 23 Jun 2016 15:39:43 +0100, Ben Bacarisse wrote: > Steven D'Aprano writes: > >> On Thursday 23 June 2016 14:40, Dan Sommers wrote: >> Since x == y, the answer should be the same as for any other pair of x == y. >>> >>> When x == y == 0,

[issue27033] Change the decode_data default in smtpd to False

2016-06-23 Thread R. David Murray
R. David Murray added the comment: Yes. Thanks, Serhiy. -- resolution: -> fixed stage: commit review -> resolved status: open -> closed ___ Python tracker

[issue27364] Deprecate invalid unicode escape sequences

2016-06-23 Thread R. David Murray
R. David Murray added the comment: Have you searched the python-dev and python-ideas archives for the previous discussions of this issue? I don't remember for sure, but I think Guido might have made a ruling (not that the discussion couldn't be reopened if he has, but, well...) --

Re: Can math.atan2 return INF?

2016-06-23 Thread Ben Bacarisse
Steven D'Aprano writes: > On Thursday 23 June 2016 14:40, Dan Sommers wrote: > >>> Since x == y, the answer should be the same as for any other pair of x == y. >> >> When x == y == 0, then atan2(y, x) is 0. I see just added noise by making the same comment

Re: Can math.atan2 return INF?

2016-06-23 Thread Ben Bacarisse
Steven D'Aprano writes: > On Thu, 23 Jun 2016 05:17 am, Ben Bacarisse wrote: > >> pdora...@pas-de-pub-merci.mac.com (Pierre-Alain Dorange) writes: >> >>> Ben Bacarisse wrote: >>> >>> math.atan2(INF, INF) 0.7853981633974483 I

[issue27363] Complex with negative zero imaginary part

2016-06-23 Thread R. David Murray
R. David Murray added the comment: Breaking the repr invariant would be bad. Agree with rejection. -- nosy: +r.david.murray resolution: -> rejected stage: -> resolved status: open -> closed ___ Python tracker

Re: Operator Precedence/Boolean Logic

2016-06-23 Thread Random832
On Thu, Jun 23, 2016, at 08:37, Steven D'Aprano wrote: > You keep saying that, but I've never seen it happen. I've seen cases > where people have been surprised by the unexpected truthiness of an > object ("I expected an exhausted iterator to be false, but it was > true"), but that's not what you

Re: Operator Precedence/Boolean Logic

2016-06-23 Thread Antoon Pardon
Op 23-06-16 om 14:37 schreef Steven D'Aprano: > So I'm not really sure what you are trying to describe. I guess it might be > something like this: > > def spam(alist): > if alist: > process(alist) > else: > print("empty list") > > > If you pass 1 instead of an actual list,

Re: Operator Precedence/Boolean Logic

2016-06-23 Thread Random832
On Thu, Jun 23, 2016, at 02:34, Andreas Röhler wrote: > Indeed, why should the result of 4 - 4 have a different truth-value > than 4 - 3 ? This implementation seems to be a legacy from languages > without boolean types. A set which included Python until version 2.3. --

Re: not able to install mysqldb-python

2016-06-23 Thread INADA Naoki
Try this https://pypi.python.org/pypi/mysqlclient On Thu, Jun 23, 2016 at 9:11 PM, Arshpreet Singh wrote: > I am trying to run django project in virtual environment. it needs mysql > database library but when I try to install that it returns the error that > configparser is

ANN: Astropy v1.2 released

2016-06-23 Thread Thomas Robitaille
Dear colleagues, We are very happy to announce the v1.2 release of the Astropy package, a core Python package for Astronomy: http://www.astropy.org Astropy is a community-driven Python package intended to contain much of the core functionality and common tools needed for astronomy and

Re: Operator Precedence/Boolean Logic

2016-06-23 Thread Steven D'Aprano
On Thu, 23 Jun 2016 08:21 pm, Antoon Pardon wrote: > Op 23-06-16 om 11:39 schreef Steven D'Aprano: [...] >> To decide on a branch, you don't need an actual bool, anything capable of >> acting like a bool will do. As a language design, ALL objects are capable >> of acting like a bool. Python has a

not able to install mysqldb-python

2016-06-23 Thread Arshpreet Singh
I am trying to run django project in virtual environment. it needs mysql database library but when I try to install that it returns the error that configparser is not installed but I have installed configparser still the error remains same, is this ubuntu bug? (env) ubuntu@ip-:~/clearapp$ pip

Re: Operator Precedence/Boolean Logic

2016-06-23 Thread Andreas Röhler
On 23.06.2016 14:08, Antoon Pardon wrote: Op 23-06-16 om 13:45 schreef Chris Angelico: On Thu, Jun 23, 2016 at 7:23 PM, Antoon Pardon wrote: I don't care. In modern mathematics, zero is usaly defined as the empty set. The empty set contains nothing, but it

Re: Operator Precedence/Boolean Logic

2016-06-23 Thread Chris Angelico
On Thu, Jun 23, 2016 at 10:05 PM, Jussi Piitulainen wrote: > Is "sq" mnemonic for something? Presumably "sequence", which fits the other assumption that you noted: that calling 'iter' on it will produce a non-destructive iterator. I hope that code is never used on

Re: Operator Precedence/Boolean Logic

2016-06-23 Thread Antoon Pardon
Op 23-06-16 om 13:45 schreef Chris Angelico: > On Thu, Jun 23, 2016 at 7:23 PM, Antoon Pardon > wrote: >> I don't care. In modern mathematics, zero is usaly defined as the >> empty set. The empty set contains nothing, but it isn't nothing >> itself. Otherwise the

Re: Operator Precedence/Boolean Logic

2016-06-23 Thread Jussi Piitulainen
Antoon Pardon writes: > Op 23-06-16 om 12:59 schreef Marko Rauhamaa: >> Antoon Pardon : >> >>> Op 23-06-16 om 11:53 schreef Marko Rauhamaa: >>> Maybe something like this: >>> >>> def empty(sq): >>> try: >>> iter(sq).next() >>> except StopIteration:

Re: Break and Continue: While Loops

2016-06-23 Thread Jon Ribbens
On 2016-06-23, Chris Angelico wrote: > On Thu, Jun 23, 2016 at 8:15 PM, BartC wrote: >> Actually pretty much any expression can be used, because Python can >> interpret almost anything as either True or False. Don't ask for the rules >> because they can be

Re: Operator Precedence/Boolean Logic

2016-06-23 Thread Chris Angelico
On Thu, Jun 23, 2016 at 7:23 PM, Antoon Pardon wrote: > I don't care. In modern mathematics, zero is usaly defined as the > empty set. The empty set contains nothing, but it isn't nothing > itself. Otherwise the empty set would be the same as the set > containing the

Re: Break and Continue: While Loops

2016-06-23 Thread Chris Angelico
On Thu, Jun 23, 2016 at 8:15 PM, BartC wrote: > Actually pretty much any expression can be used, because Python can > interpret almost anything as either True or False. Don't ask for the rules > because they can be complicated, but for example, zero is False, and any > other

Re: Operator Precedence/Boolean Logic

2016-06-23 Thread Antoon Pardon
Op 23-06-16 om 12:59 schreef Marko Rauhamaa: > Antoon Pardon : > >> Op 23-06-16 om 11:53 schreef Marko Rauhamaa: >> Maybe something like this: >> >> def empty(sq): >> try: >> iter(sq).next() >> except StopIteration: >> return False >>

Re: Operator Precedence/Boolean Logic

2016-06-23 Thread Marko Rauhamaa
Antoon Pardon : > Op 23-06-16 om 11:53 schreef Marko Rauhamaa: > Maybe something like this: > > def empty(sq): > try: > iter(sq).next() > except StopIteration: > return False > except: > raise TypeError > else: > return

Re: Operator Precedence/Boolean Logic

2016-06-23 Thread Antoon Pardon
Op 23-06-16 om 11:53 schreef Marko Rauhamaa: > Antoon Pardon : > >> Op 23-06-16 om 11:10 schreef Marko Rauhamaa: >>> The __len__ method is not guaranteed to execute in O(1). See: >>> >>>https://docs.python.org/3/reference/datamodel.html?highlig >>>

RE: Guys, can you please share me some sites where we can practice python programs for beginners and Intermediate.

2016-06-23 Thread Joe Gulizia
From: Python-list on behalf of Pushpanth Gundepalli Sent: Thursday, June 23, 2016 12:35 AM To: python-list@python.org Subject: Re: Guys, can you please share me some sites

Re: Operator Precedence/Boolean Logic

2016-06-23 Thread Antoon Pardon
Op 23-06-16 om 11:39 schreef Steven D'Aprano: > On Thursday 23 June 2016 17:58, Antoon Pardon wrote: > >> Op 23-06-16 om 05:59 schreef Steven D'Aprano: >>> On Thu, 23 Jun 2016 01:12 pm, Larry Hudson wrote: >>> On 06/22/2016 12:42 AM, Lawrence D’Oliveiro wrote: [snip] > I feel that’s

Re: Break and Continue: While Loops

2016-06-23 Thread BartC
On 23/06/2016 05:17, Elizabeth Weiss wrote: CODE #1: i=0 while True: i=i+1 if i==2: print("Skipping 2") continue if i==5: print("Breaking") break print(i) -- Questions: 2. i=i+1- I never understand this. Why isn't it i=i+2? 3. Do the results not include 2

Re: Operator Precedence/Boolean Logic

2016-06-23 Thread Andreas Röhler
On 23.06.2016 11:46, Marko Rauhamaa wrote: Ridiculous? It was this line of thinking that led Paul Dirac to predict the existence of antimatter. Marko Yeah. Maybe we could construct examples already using antagonistic charges of electrons? --

Re: Operator Precedence/Boolean Logic

2016-06-23 Thread Marko Rauhamaa
Antoon Pardon : > Op 23-06-16 om 11:10 schreef Marko Rauhamaa: >> The __len__ method is not guaranteed to execute in O(1). See: >> >>https://docs.python.org/3/reference/datamodel.html?highlig >>ht=__len__#object.__len__> > > As far as I can see, neither is

  1   2   >