Re: Assignment Versus Equality

2016-06-27 Thread Rustom Mody
On Tuesday, June 28, 2016 at 9:55:39 AM UTC+5:30, Marko Rauhamaa wrote: > sohcahtoa82: > > > On Monday, June 27, 2016 at 7:09:35 AM UTC-7, Marko Rauhamaa wrote: > >> Grant Edwards : > >> > Were there other languages that did something similar? > >> > >> In XML, whitespace between tags is signific

Re: Can math.atan2 return INF?

2016-06-27 Thread Steven D'Aprano
On Tuesday 28 June 2016 16:12, Gregory Ewing wrote: > Rustom Mody wrote: >> I said that for the Haskell list [0..] >> >> [0..] ++ [-1] == [0..] >> >> He said (in effect) yes that -1 would not be detectable but its still there! > > The code to generate it is there, but it will never > be execute

Re: Can math.atan2 return INF?

2016-06-27 Thread Rustom Mody
On Tuesday, June 28, 2016 at 11:42:29 AM UTC+5:30, Gregory Ewing wrote: > Rustom Mody wrote: > > I said that for the Haskell list [0..] > > > > [0..] ++ [-1] == [0..] > > > > He said (in effect) yes that -1 would not be detectable but its still there! > > The code to generate it is there, but it

Re: Assignment Versus Equality

2016-06-27 Thread Gregory Ewing
Dennis Lee Bieber wrote: Or my favorite example of a parser headache: which is the loop instruction and which is the assignment DO10I=3,14 DO 10 I = 3.14 And if the programmer and/or compiler gets it wrong, your spacecraft crashes into the planet. -- Greg -- https://ma

Re: Can math.atan2 return INF?

2016-06-27 Thread Marko Rauhamaa
Gregory Ewing : > Marko Rauhamaa wrote: >> We cannot get any information on black holes proper because black holes >> cannot come into existence according to the very theory that predicts >> black holes. It will take infinitely long for an event horizon to form. > > Only in some frames of referenc

Re: Assignment Versus Equality

2016-06-27 Thread Rustom Mody
On Tuesday, June 28, 2016 at 11:12:59 AM UTC+5:30, Steven D'Aprano wrote: > On Tuesday 28 June 2016 14:31, Rustom Mody wrote: > > > On Tuesday, June 28, 2016 at 6:36:06 AM UTC+5:30, Steven D'Aprano wrote: > >> On Tue, 28 Jun 2016 12:23 am, Rustom Mody wrote: > >> > Also how is GG deliberately down

Re: Assignment Versus Equality

2016-06-27 Thread Gregory Ewing
BartC wrote: You mean the rationale was based on saving keystrokes? Maybe disk space as well -- bytes were expensive in those days! -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Assignment Versus Equality

2016-06-27 Thread Marko Rauhamaa
Chris Angelico : > Or Windows-1252, but declared as Latin-1. (Bane of my life.) J Marko -- https://mail.python.org/mailman/listinfo/python-list

Re: Can math.atan2 return INF?

2016-06-27 Thread Gregory Ewing
Marko Rauhamaa wrote: We cannot get any information on black holes proper because black holes cannot come into existence according to the very theory that predicts black holes. It will take infinitely long for an event horizon to form. Only in some frames of reference. By your reasoning, Zeno'

Re: Can math.atan2 return INF?

2016-06-27 Thread Gregory Ewing
Rustom Mody wrote: I said that for the Haskell list [0..] [0..] ++ [-1] == [0..] He said (in effect) yes that -1 would not be detectable but its still there! The code to generate it is there, but it will never be executed, so the compiler is entitled to optimise it away. :-) He may have a po

Re: Meta decorator with parameters, defined in explicit functions

2016-06-27 Thread Paul Rubin
Ben Finney writes: > decorator_with_args = lambda decorator: lambda *args, **kwargs: > lambda func: decorator(func, *args, **kwargs) > I would like to see a more Pythonic, more explicit and expressive > replacement with its component parts easily understood. How's this: from functools im

Re: Assignment Versus Equality

2016-06-27 Thread Chris Angelico
On Tue, Jun 28, 2016 at 3:42 PM, Steven D'Aprano wrote: > And how does that encourage clients to support Unicode? It just enables > developers to tell themselves "It's just a few weirdos and foreigners who use > Unicode, ASCII [by which they mean Latin 1] is good enough for everyone." > Or Window

Re: Assignment Versus Equality

2016-06-27 Thread Steven D'Aprano
On Tuesday 28 June 2016 14:31, Rustom Mody wrote: > On Tuesday, June 28, 2016 at 6:36:06 AM UTC+5:30, Steven D'Aprano wrote: >> On Tue, 28 Jun 2016 12:23 am, Rustom Mody wrote: >> > Also how is GG deliberately downgrading clear unicode content to be kind >> > to obsolete clients at recipient end d

Re: Meta decorator with parameters, defined in explicit functions

2016-06-27 Thread Zachary Ware
On Tue, Jun 28, 2016 at 12:02 AM, Ben Finney wrote: > Howdy all, > > I want an explicit replacement for a common decorator idiom. > > There is a clever one-line decorator that has been copy-pasted without > explanation in many code bases for many years:: > > decorator_with_args = lambda decora

Re: Assignment Versus Equality

2016-06-27 Thread Rustom Mody
On Monday, June 27, 2016 at 8:19:05 PM UTC+5:30, Alain Ketterlin wrote: > Grant Edwards writes: > > Did the poor sod who wrote the compiler think it was a good idea? > > I don't know, but he has a good excuse: he was one of the first to ever > write a compiler (see https://en.wikipedia.org/wiki/Co

Meta decorator with parameters, defined in explicit functions

2016-06-27 Thread Ben Finney
Howdy all, I want an explicit replacement for a common decorator idiom. There is a clever one-line decorator that has been copy-pasted without explanation in many code bases for many years:: decorator_with_args = lambda decorator: lambda *args, **kwargs: lambda func: decorator(func, *args,

[RELEASE] Python 2.7.12

2016-06-27 Thread Benjamin Peterson
It is my privilege to present you with another release in the Python 2.7 series, Python 2.7.12. Since the release candidate, there were two changes: - The Windows binaries have been changed to use OpenSSL 1.0.2h. - The "about" dialog in IDLE was fixed. Downloads, as always, are on python.org:

Re: Assignment Versus Equality

2016-06-27 Thread Rustom Mody
On Tuesday, June 28, 2016 at 6:36:06 AM UTC+5:30, Steven D'Aprano wrote: > On Tue, 28 Jun 2016 12:23 am, Rustom Mody wrote: > > Also how is GG deliberately downgrading clear unicode content to be kind > > to obsolete clients at recipient end different from python 2 → 3 making > > breaking changes b

Re: __all__ attribute: bug and proposal

2016-06-27 Thread Zachary Ware
On Mon, Jun 27, 2016 at 7:32 PM, Chris Angelico wrote: > If you're primarily worried about classes and functions, here's a neat > trick you can use: > > __all__ = [] > def all(thing): > __all__.append(thing.__name__) > return thing Barry Warsaw has written a nice decorator called 'public'

Re: Assignment Versus Equality

2016-06-27 Thread Marko Rauhamaa
sohcahto...@gmail.com: > On Monday, June 27, 2016 at 7:09:35 AM UTC-7, Marko Rauhamaa wrote: >> Grant Edwards : >> > Were there other languages that did something similar? >> >> In XML, whitespace between tags is significant unless the document type >> says otherwise. On the other hand, leading a

Re: Question on compiling on linux

2016-06-27 Thread Michael Torrie
On 06/27/2016 08:28 PM, Steven D'Aprano wrote: > On Tue, 28 Jun 2016 10:01 am, Dennis Lee Bieber wrote: > >> The Outlook style works well in a business environment where the >> recipient is likely the original sender of the quoted text, and doesn't >> need the context -- the quoted copy is just a

Re: __all__ attribute: bug and proposal

2016-06-27 Thread Steven D'Aprano
On Tue, 28 Jun 2016 12:46 pm, Terry Reedy wrote: > On 6/27/2016 6:29 PM, Pavel S wrote: > >> Frankly, do you always unit-test if __all__ works? > > One should. CPython's test suite includes test___all__. I believe it > imports every stdlib module, looks for __all__, and if present, tests > tha

Re: Question on compiling on linux

2016-06-27 Thread Steven D'Aprano
Oh, and while I'm ranting about top-posting, there's another reason why it's shit. Speaking from experience, it makes searching email archives awful. I've been in the position of having to go through email archives looking for relevant email discussions related to a legal dispute. Trying to search

Re: __all__ attribute: bug and proposal

2016-06-27 Thread Terry Reedy
On 6/27/2016 6:29 PM, Pavel S wrote: Frankly, do you always unit-test if __all__ works? One should. CPython's test suite includes test___all__. I believe it imports every stdlib module, looks for __all__, and if present, tests that it works. It probably executes 'from module import *'. A

Re: Question on compiling on linux

2016-06-27 Thread Steven D'Aprano
On Tue, 28 Jun 2016 10:01 am, Dennis Lee Bieber wrote: > The Outlook style works well in a business environment where the > recipient is likely the original sender of the quoted text, and doesn't > need the context -- the quoted copy is just a courtesy copy in this case. No it doesn't work well.

Re: __all__ attribute: bug and proposal

2016-06-27 Thread Random832
On Mon, Jun 27, 2016, at 20:32, Chris Angelico wrote: > If you're primarily worried about classes and functions, here's a neat > trick you can use: How about just __all__ = [list of stuff including classes and functions] __all__ = [x if isinstance(x, str) else x.__name__ for x in __all__] -- htt

RE: argparse and subparsers

2016-06-27 Thread Joseph L. Casale
> Not sure if this fits the bill, or makes sense here, but I came cross > "docopt" which touts itself as a "Command-line interface description > language". I used it in a project and it seems to be pretty easy to use > as well as elegant. It stores the arguments & values as a dictionary, > keyed by

Re: __all__ attribute: bug and proposal

2016-06-27 Thread Chris Angelico
On Tue, Jun 28, 2016 at 11:55 AM, MRAB wrote: > On 2016-06-28 01:32, Chris Angelico wrote: > [snip] > >> If you're primarily worried about classes and functions, here's a neat >> trick you can use: >> >> __all__ = [] >> def all(thing): >> __all__.append(thing.__name__) >> return thing >> >

Re: __all__ attribute: bug and proposal

2016-06-27 Thread Steven D'Aprano
On Tue, 28 Jun 2016 06:56 am, Pavel S wrote: > Hi, > I today uncovered subtle bug and would like to share it with you. > > By a mistake, I forgot to put comma into '__all__' tuple of some module. > Notice missing comma after 'B'. > > # module foo.py > __all__ = ( > 'A', > 'B' > 'C',

Re: __all__ attribute: bug and proposal

2016-06-27 Thread MRAB
On 2016-06-28 01:32, Chris Angelico wrote: [snip] If you're primarily worried about classes and functions, here's a neat trick you can use: __all__ = [] def all(thing): __all__.append(thing.__name__) return thing Err... won't that hide the 'all' builtin? -- https://mail.python.org/ma

Re: Assignment Versus Equality

2016-06-27 Thread Steven D'Aprano
On Mon, 27 Jun 2016 11:59 pm, Grant Edwards wrote: > On 2016-06-26, BartC wrote: > >> (Note, for those who don't know (old) Fortran, that spaces and tabs are >> not significant. So those dots are needed, otherwise "a eq b" would be >> parsed as "aeqb".) > > I've always been baffled by that. >

Re: Assignment Versus Equality

2016-06-27 Thread Steven D'Aprano
On Tue, 28 Jun 2016 01:27 am, MRAB wrote: > On 2016-06-27 14:59, Grant Edwards wrote: >> On 2016-06-26, BartC wrote: >> >>> (Note, for those who don't know (old) Fortran, that spaces and tabs are >>> not significant. So those dots are needed, otherwise "a eq b" would be >>> parsed as "aeqb".) >>

Re: Where do i find the 32 bit libraries on my 64 bit ubuntu system

2016-06-27 Thread Lawrence D’Oliveiro
On Tuesday, June 28, 2016 at 5:37:29 AM UTC+12, Steven Truppe wrote: > i want to write an application that works for both 32 bit and 64bit on > my 64bit ubuntu system, my problem i only find 64bit libraries under > /usr/lib, there is also a path callled /x86_64-linux-gnu/ <- are these > the libr

Re: Assignment Versus Equality

2016-06-27 Thread Lawrence D’Oliveiro
On Tuesday, June 28, 2016 at 2:23:16 AM UTC+12, Rustom Mody wrote: > python 2 → 3 making breaking changes but not going beyond ASCII lexemes? You do know Python 3 allows Unicode letters in identifiers, right? -- https://mail.python.org/mailman/listinfo/python-list

Re: Assignment Versus Equality

2016-06-27 Thread Steven D'Aprano
On Tue, 28 Jun 2016 12:23 am, Rustom Mody wrote: > On Monday, June 27, 2016 at 6:58:26 PM UTC+5:30, Steven D'Aprano wrote: >> On Mon, 27 Jun 2016 10:48 pm, Rustom Mody wrote: >> >> > PS Google Groups is wise enough to jump through hoops trying to encode >> > my message above as latin-1, then as W

Re: Assignment Versus Equality

2016-06-27 Thread sohcahtoa82
On Monday, June 27, 2016 at 7:09:35 AM UTC-7, Marko Rauhamaa wrote: > Grant Edwards : > > > On 2016-06-26, BartC wrote: > > > >> (Note, for those who don't know (old) Fortran, that spaces and tabs > >> are not significant. So those dots are needed, otherwise "a eq b" > >> would be parsed as "aeqb

Re: __all__ attribute: bug and proposal

2016-06-27 Thread Chris Angelico
On Tue, Jun 28, 2016 at 6:56 AM, Pavel S wrote: > By a mistake, I forgot to put comma into '__all__' tuple of some module. > Notice missing comma after 'B'. > > # module foo.py > __all__ = ( > 'A', > 'B' > 'C', > ) > > class A: pass > class B: pass > class C: pass > > If you try to im

Re: Getting back into PyQt and not loving it.

2016-06-27 Thread Michael Torrie
On 06/27/2016 02:14 PM, codewiz...@gmail.com wrote: > On Sunday, June 26, 2016 at 5:45:18 PM UTC-4, Michael Torrie wrote: >> >> Qt's a fantastic toolkit, and the most mature of any of them, and the >> most portable, but man the bindings are not Pythonic at all. > > Enaml feels pretty Pythonic to m

Re: __all__ attribute: bug and proposal

2016-06-27 Thread Random832
On Mon, Jun 27, 2016, at 16:56, Pavel S wrote: > Porposal: allow putting objects into __all__ directly, so possible > problems will be found earlier: Question: What happens if the object in __all__ isn't the same object that's in the module? -- https://mail.python.org/mailman/listinfo/python-list

Re: Assignment Versus Equality

2016-06-27 Thread BartC
On 27/06/2016 23:45, Lawrence D’Oliveiro wrote: On Tuesday, June 28, 2016 at 3:27:40 AM UTC+12, MRAB wrote: On 2016-06-27 14:59, Grant Edwards wrote: Why would a language designer think it a good idea? It let you have identifiers like "grand total"; there was no need for camel case or undersc

Re: Getting back into PyQt and not loving it.

2016-06-27 Thread Ethan Furman
On 06/26/2016 07:12 PM, MRAB wrote: Is it a problem with Tk itself or with the Python wrapper? Would it be better if we made a more Pythonic version of Tkinter, e.g. making Frame.title a property? I would say it's the wrapper. I appreciate all the work being done on tkinter lately, but it's s

Re: Operator Precedence: One Thing Python Got Right

2016-06-27 Thread Lawrence D’Oliveiro
On Tuesday, June 28, 2016 at 2:32:48 AM UTC+12, Grant Edwards wrote: > > On 2016-06-27, BartC wrote: > >> I bet your code isn't very 'Pythonic' then! > > No, not when the end goal is to move it into C. I wonder: how much real-world C code would be broken if the operator precedences in C were cha

Re: Assignment Versus Equality

2016-06-27 Thread Lawrence D’Oliveiro
On Tuesday, June 28, 2016 at 3:27:40 AM UTC+12, MRAB wrote: > On 2016-06-27 14:59, Grant Edwards wrote: >> Why would a language designer think it a good idea? >> > It let you have identifiers like "grand total"; there was no need for > camel case or underscores to separate the parts of the name.

Re: __all__ attribute: bug and proposal

2016-06-27 Thread Chris Angelico
On Tue, Jun 28, 2016 at 8:29 AM, Pavel S wrote: >> but what about integers or strings? > > Can you provide example? Sure. I'll spare you the wall of text that is os.__all__, but here's the types: >>> import os >>> {type(getattr(os, x)).__name__ for x in os.__all__} {'bool', 'module', 'function',

Re: __all__ attribute: bug and proposal

2016-06-27 Thread Pavel S
> but what about integers or strings? Can you provide example? --- No matter if __all__ uses names or objects, I think it should be validated not only when importing '*', but always. Frankly, do you always unit-test if __all__ works? -- https://mail.python.org/mailman/listinfo/python-list

Re: Assignment Versus Equality

2016-06-27 Thread Lawrence D’Oliveiro
On Tuesday, June 28, 2016 at 3:27:40 AM UTC+12, MRAB wrote: > > On 2016-06-27 14:59, Grant Edwards wrote: >> >> Were there other languages that did something similar? >> > Algol 60 and Algog 68. Algol 68 was actually slightly different. There were two separate alphabets: one used for names of con

Re: __all__ attribute: bug and proposal

2016-06-27 Thread Chris Angelico
On Tue, Jun 28, 2016 at 6:56 AM, Pavel S wrote: > Porposal: allow putting objects into __all__ directly, so possible problems > will be found earlier: > > # module foo.py > class A: pass > class B: pass > class C: pass > > __all__ = (A, B, C) > > Note: this currently don't work. > from foo i

Transcrypt - Games for Kids

2016-06-27 Thread Salvatore DI DIO
Hello, I am using Transcrypt (Python to Javascript translator) to create games for kids, and introduce them to programming. You can give an eye here : https://github.com/artyprog/GFK Regards -- https://mail.python.org/mailman/listinfo/python-list

__all__ attribute: bug and proposal

2016-06-27 Thread Pavel S
Hi, I today uncovered subtle bug and would like to share it with you. By a mistake, I forgot to put comma into '__all__' tuple of some module. Notice missing comma after 'B'. # module foo.py __all__ = ( 'A', 'B' 'C', ) class A: pass class B: pass class C: pass If you try to import

Re: Getting back into PyQt and not loving it.

2016-06-27 Thread codewizard
On Sunday, June 26, 2016 at 5:45:18 PM UTC-4, Michael Torrie wrote: > > Qt's a fantastic toolkit, and the most mature of any of them, and the > most portable, but man the bindings are not Pythonic at all. Enaml feels pretty Pythonic to me: https://github.com/nucleic/enaml -- https://mail.python

Re: Where do i find the 32 bit libraries on my 64 bit ubuntu system

2016-06-27 Thread Grant Edwards
On 2016-06-27, Steven Truppe wrote: > i want to write an application that works for both 32 bit and 64bit on > my 64bit ubuntu system, my problem i only find 64bit libraries under > /usr/lib, there is also a path callled /x86_64-linux-gnu/ <- are these > the libraries i should use for 32 bit a

Re: Where do i find the 32 bit libraries on my 64 bit ubuntu system

2016-06-27 Thread Rustom Mody
On Monday, June 27, 2016 at 11:07:29 PM UTC+5:30, Steven Truppe wrote: > Hi all, > > i want to write an application that works for both 32 bit and 64bit on > my 64bit ubuntu system, my problem i only find 64bit libraries under > /usr/lib, there is also a path callled /x86_64-linux-gnu/ <- are th

Where do i find the 32 bit libraries on my 64 bit ubuntu system

2016-06-27 Thread Steven Truppe
Hi all, i want to write an application that works for both 32 bit and 64bit on my 64bit ubuntu system, my problem i only find 64bit libraries under /usr/lib, there is also a path callled /x86_64-linux-gnu/ <- are these the libraries i should use for 32 bit and 64 bit programming ?? -- https:/

Re: Getting back into PyQt and not loving it.

2016-06-27 Thread llanitedave
On Sunday, June 26, 2016 at 11:16:01 PM UTC-7, John Ladasky wrote: > On Sunday, June 26, 2016 at 7:41:17 PM UTC-7, Michael Torrie wrote: > > If GTK+ had first-class support on Windows and Mac, including native > > themes and seamless UI integration (file and print dialogs), I'd say > > GTK+ would b

Re: argparse and subparsers

2016-06-27 Thread Sachin Garg
On Monday 27 June 2016 06:28 AM, Steven D'Aprano wrote: > On Monday 27 June 2016 15:34, Lawrence D’Oliveiro wrote: > >> On Monday, June 27, 2016 at 4:56:10 PM UTC+12, Sachin Garg wrote: >> >>> # Set verbose flag >>> verbose = False >>> if arguments['--verbose']: >>> verbose = True >>> elif arg

Re: Can math.atan2 return INF?

2016-06-27 Thread Marko Rauhamaa
Rustom Mody : > On Monday, June 27, 2016 at 7:42:26 PM UTC+5:30, Marko Rauhamaa wrote: >> I'm a formalist. > > Well then formalism is semantics-free: What matters it if an argument > is theological or scientific as long as it is (internally) consistent? That's what I'm saying: black holes can't e

Live installation of Pandas for Windows 64

2016-06-27 Thread David Shi via Python-list
Is there a live installation of Pandas for Windows 64? Regards. David -- https://mail.python.org/mailman/listinfo/python-list

Re: [Python-Dev] [RELEASED] Python 3.4.5 and Python 3.5.2 are now available

2016-06-27 Thread Steve Dower
On 26Jun2016 1932, Larry Hastings wrote: https://www.python.org/downloads/release/python-352/ ... /p.s. There appears to be a small oops with the Windows installers for 3.5.2--uploaded to the wrong directory or something. They'll be available soon, honest! That oops is now fixed, but I wanted

Re: Assignment Versus Equality

2016-06-27 Thread Gene Heskett
On Monday 27 June 2016 09:28:00 Steven D'Aprano wrote: > On Mon, 27 Jun 2016 10:48 pm, Rustom Mody wrote: > > PS Google Groups is wise enough to jump through hoops trying to > > encode my message above as latin-1, then as Windows 1252 and only > > when that does not work as UTF-8 > > There is noth

Re: Assignment Versus Equality

2016-06-27 Thread Grant Edwards
On 2016-06-27, MRAB wrote: > On 2016-06-27 14:59, Grant Edwards wrote: >> On 2016-06-26, BartC wrote: >> >>> (Note, for those who don't know (old) Fortran, that spaces and tabs are >>> not significant. So those dots are needed, otherwise "a eq b" would be >>> parsed as "aeqb".) >> >> I've always

Re: Assignment Versus Equality

2016-06-27 Thread MRAB
On 2016-06-27 14:59, Grant Edwards wrote: On 2016-06-26, BartC wrote: (Note, for those who don't know (old) Fortran, that spaces and tabs are not significant. So those dots are needed, otherwise "a eq b" would be parsed as "aeqb".) I've always been baffled by that. Were there other language

Re: Getting back into PyQt and not loving it.

2016-06-27 Thread Michael Torrie
On 06/27/2016 12:44 AM, Lawrence D’Oliveiro wrote: > On Monday, June 27, 2016 at 6:16:01 PM UTC+12, John Ladasky wrote: > >> Between the Py3 requirement and the need to work with all major OS's, I >> decided to learn PyQt and not GTK+. > > GTK+ is available for Python 3. > > No doubt it will wo

Re: Language improvement: Get more from the `for .. else` clause

2016-06-27 Thread Michael Selik
On Mon, Jun 27, 2016 at 12:53 AM Victor Savu wrote: > capture the [StopIteration] value in the `else` statement of the `for` loop > I'm having trouble thinking of a case when this new feature is necessary. Can you show a more realistic example? -- https://mail.python.org/mailman/listinfo/python

Re: Assignment Versus Equality

2016-06-27 Thread Alain Ketterlin
Grant Edwards writes: > On 2016-06-26, BartC wrote: > >> (Note, for those who don't know (old) Fortran, that spaces and tabs are >> not significant. So those dots are needed, otherwise "a eq b" would be >> parsed as "aeqb".) > > I've always been baffled by that. > Were there other languages th

Re: Operator Precedence: One Thing Python Got Right

2016-06-27 Thread Grant Edwards
On 2016-06-27, BartC wrote: > On 27/06/2016 15:04, Grant Edwards wrote: >> On 2016-06-27, Steven D'Aprano wrote: >> >>> Do you write much Python code that you expect to also be valid C code? >> >> Depends on what you mean by "much", but yes, it's certainly >> something I do. I often develop and

Re: Can math.atan2 return INF?

2016-06-27 Thread Rustom Mody
On Monday, June 27, 2016 at 7:42:26 PM UTC+5:30, Marko Rauhamaa wrote: > Rustom Mody : > > > On Monday, June 27, 2016 at 7:16:03 PM UTC+5:30, Marko Rauhamaa wrote: > >> Georg Cantor would probably be with your colleague, but then, Georg > >> Cantor was not a scientist. > > > > I'm mystified > > >

Re: Assignment Versus Equality

2016-06-27 Thread Rustom Mody
On Monday, June 27, 2016 at 6:58:26 PM UTC+5:30, Steven D'Aprano wrote: > On Mon, 27 Jun 2016 10:48 pm, Rustom Mody wrote: > > > PS Google Groups is wise enough to jump through hoops trying to encode my > > message above as latin-1, then as Windows 1252 and only when that does not > > work as UTF-

Re: Operator Precedence: One Thing Python Got Right

2016-06-27 Thread BartC
On 27/06/2016 15:04, Grant Edwards wrote: On 2016-06-27, Steven D'Aprano wrote: Do you write much Python code that you expect to also be valid C code? Depends on what you mean by "much", but yes, it's certainly something I do. I often develop and test algorithms in Python and then cut/paste

Re: Assignment Versus Equality

2016-06-27 Thread Rustom Mody
On Monday, June 27, 2016 at 7:30:05 PM UTC+5:30, Grant Edwards wrote: > On 2016-06-26, BartC > > (Note, for those who don't know (old) Fortran, that spaces and tabs are > > not significant. So those dots are needed, otherwise "a eq b" would be > > parsed as "aeqb".) > > I've always been baffled

Re: Can math.atan2 return INF?

2016-06-27 Thread Marko Rauhamaa
Rustom Mody : > On Monday, June 27, 2016 at 7:16:03 PM UTC+5:30, Marko Rauhamaa wrote: >> Georg Cantor would probably be with your colleague, but then, Georg >> Cantor was not a scientist. > > I'm mystified > > Earlier (I thought) you were on the Platonist = {Cantor, Hilbert...} > side > Now you s

Re: Assignment Versus Equality

2016-06-27 Thread Marko Rauhamaa
Grant Edwards : > On 2016-06-26, BartC wrote: > >> (Note, for those who don't know (old) Fortran, that spaces and tabs >> are not significant. So those dots are needed, otherwise "a eq b" >> would be parsed as "aeqb".) > > I've always been baffled by that. > > Were there other languages that did

Re: Can math.atan2 return INF?

2016-06-27 Thread Rustom Mody
On Monday, June 27, 2016 at 7:16:03 PM UTC+5:30, Marko Rauhamaa wrote: > Rustom Mody : > > > I am reminded of an argument I once had with a colleague about > > infinite, lazy data-structures > > > > I said that for the Haskell list [0..] > > > > [0..] ++ [-1] == [0..] > > [...] > > > He said (in

Re: Operator Precedence: One Thing Python Got Right

2016-06-27 Thread Grant Edwards
On 2016-06-27, Steven D'Aprano wrote: > Do you write much Python code that you expect to also be valid C code? Depends on what you mean by "much", but yes, it's certainly something I do. I often develop and test algorithms in Python and then cut/paste much of the Python code into C programs. T

Re: Assignment Versus Equality

2016-06-27 Thread Marko Rauhamaa
Steven D'Aprano : > On Mon, 27 Jun 2016 10:48 pm, Rustom Mody wrote: > >> PS Google Groups is wise enough to jump through hoops trying to >> encode my message above as latin-1, then as Windows 1252 and only >> when that does not work as UTF-8 > > There is nothing admirable about GG (or any other n

Re: Assignment Versus Equality

2016-06-27 Thread Grant Edwards
On 2016-06-26, BartC wrote: > (Note, for those who don't know (old) Fortran, that spaces and tabs are > not significant. So those dots are needed, otherwise "a eq b" would be > parsed as "aeqb".) I've always been baffled by that. Were there other languages that did something similar? Why wou

Re: Question on compiling on linux

2016-06-27 Thread Random832
On Mon, Jun 27, 2016, at 00:26, Zachary Ware wrote: > A: Because you have to read things in reverse order. > Q: Why? > A: Top-posting. > Q: What's one of the most annoying common email practices? Which is witty, but doesn't *actually* explain why it's bad. 1. The intent, as I understand it, with

Re: Can math.atan2 return INF?

2016-06-27 Thread Marko Rauhamaa
Rustom Mody : > I am reminded of an argument I once had with a colleague about > infinite, lazy data-structures > > I said that for the Haskell list [0..] > > [0..] ++ [-1] == [0..] [...] > He said (in effect) yes that -1 would not be detectable but its still > there! Georg Cantor would probabl

Re: Which one is the best JSON parser?

2016-06-27 Thread Ned Batchelder
On Monday, June 27, 2016 at 9:31:04 AM UTC-4, Nagy László Zsolt wrote: > On 2016-06-23, MRAB wrote: > >> 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. > > Which has always worked fine for

Re: Can math.atan2 return INF?

2016-06-27 Thread Nagy László Zsolt
> Thanks, I'm in the same position as you, except that I'm in the position > where I need it use the result, and if it ever returns INF my function will > blow up. But it doesn't look like that can happen. > Doesn't atan2 relies on the C lib math floating point library? At least in CPython. I thin

Re: Which one is the best JSON parser?

2016-06-27 Thread Nagy László Zsolt
On 2016-06-23, MRAB wrote: >> 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. > Which has always worked fine for me... Which always reminds me: >>> import json >>> d = {0:1, False:2} >>> d {0: 2} >>>

Re: Assignment Versus Equality

2016-06-27 Thread Steven D'Aprano
On Mon, 27 Jun 2016 10:48 pm, Rustom Mody wrote: > PS Google Groups is wise enough to jump through hoops trying to encode my > message above as latin-1, then as Windows 1252 and only when that does not > work as UTF-8 There is nothing admirable about GG (or any other newsreader or email client)

Re: Can math.atan2 return INF?

2016-06-27 Thread Rustom Mody
On Monday, June 27, 2016 at 12:10:21 PM UTC+5:30, Marko Rauhamaa wrote: > Steven D'Aprano : > > > Naive empirical falsification can, at best, be considered as a > > best-practice rule: if you have no way of falsifying something even in > > principle, then it's not scientific. But it doesn't really

Re: Assignment Versus Equality

2016-06-27 Thread Rustom Mody
On Monday, June 27, 2016 at 5:53:07 PM UTC+5:30, Bob Gailer wrote: > On Jun 26, 2016 5:29 PM, "Michael Torrie" wrote: > > > > On 06/26/2016 12:47 PM, Christopher Reimer wrote: > > > Sounds like fun. Every aspiring programmer should write an interpreter > > for some language at least once in his

Re: Assignment Versus Equality

2016-06-27 Thread Bob Gailer
On Jun 26, 2016 5:29 PM, "Michael Torrie" wrote: > > On 06/26/2016 12:47 PM, Christopher Reimer wrote: > Sounds like fun. Every aspiring programmer should write an interpreter > for some language at least once in his life! In the mid 1970' s I helped maintain an installation of IBM' s APL inter

Re: Operator Precedence: One Thing Python Got Right

2016-06-27 Thread Steven D'Aprano
On Mon, 27 Jun 2016 07:53 pm, BartC wrote: > On 27/06/2016 05:20, Lawrence D’Oliveiro wrote: >> How did I discover this? Entirely by accident: I forgot the parentheses >> one day and *didn’t* hit a bug. :) > > That's not wise. It could have worked by chance. And putting in the > parentheses anyw

Re: argparse and subparsers

2016-06-27 Thread Steven D'Aprano
On Monday 27 June 2016 15:34, Lawrence D’Oliveiro wrote: > On Monday, June 27, 2016 at 4:56:10 PM UTC+12, Sachin Garg wrote: > >> # Set verbose flag >> verbose = False >> if arguments['--verbose']: >> verbose = True >> elif arguments['-q']: >> verbose = False > > Don’t you just love code

Re: Operator Precedence: One Thing Python Got Right

2016-06-27 Thread BartC
On 27/06/2016 05:20, Lawrence D’Oliveiro wrote: There is one thing Python did not slavishly copy from C. While it has (mostly) the same operators, and exclusively adopted the iso646 names for the Boolean operators (which you can also use in C and C++, by the way, but not Java), it made a slight

Re: Empty List

2016-06-27 Thread Pierre-Alain Dorange
Elizabeth Weiss wrote: > What is the point of this code?: > > word=[] > print(word) > > The result is [] > > When would I need to use something like this? You often need to intialize a list, sometime with (empty) = []. Then after initializing you should do "something" that perhaps will fill

Running yum/apt-get from a virtualenv

2016-06-27 Thread Tiglath Suriol
Let us say that I install PostgreSQL from an activated virtualenv using yum or apt-get, will PostgrSQL be local or global? I understand that virtualenv isolates the Python environment only, so I surmise that it will make no difference installing with yum/apt-get inside or outside the virtua

Re: Getting back into PyQt and not loving it.

2016-06-27 Thread Mark Summerfield
On Monday, June 27, 2016 at 3:12:34 AM UTC+1, MRAB wrote: [snip] > > Not sure that wxPython is really any different in that respect, and Tkinter > > doesn't feel Pythonic to me, either -- considering how it's Tk at heart. > > So what's the alternative? There really is no good Python-based GUI t

Re: Getting back into PyQt and not loving it.

2016-06-27 Thread lorenzo . gatti
PyGTK is obsolete and stopped at Python 2.7, while PyGObject for Windows is several versions behind (currently 3.18 vs 3.21) and it doesn't support Python 3.5. Game over for GTK+. -- https://mail.python.org/mailman/listinfo/python-list

Re: I seem to be creating a dict that I cannot access the keys of

2016-06-27 Thread dieter
Sayth Renshaw writes: >> The code below is obviously wrong - it is surprising that you get >> anything other than an exception. See comments below inserted into >> your code. >> >> > def parseXML(): >> > ... >> > result = etree.tostring(tree.getroot(), pretty_print=True) >> >> "resul