Re: Which one is the best XML-parser?

2016-06-23 Thread dieter
David Shi via Python-list writes: > Which one is the best XML-parser? "best" is not an absolute term but depends on criteria/conditions. There are essentially two kinds of parsers: incremental parsers which parse the structure and report events for everything they see and non-incremental parse

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 code in any dict:

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 more than > one module

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 G.BD

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

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

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 other pair of > x == y. When x == y == 0, then atan2(

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 i

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. -- https://mail.python.org/

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 one to it. So i is

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 prevents a black hole

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 Dorange

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. P

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 the only solution (0) wh

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

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 th

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 True or False. Don't ask for the >>> r

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 example, zero is False

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 object is > always fal

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 comprehensio

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, then atan2(y, x) is 0. > > I see just a

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 before reading the rest of the thread.

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 would have expected NaN since atan2(INF, INF)

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 s

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. -- https://mail.python.org/mai

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 not installed but I

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 isn't nothing itself. Otherwise the

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 older Pythons that don't have e

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 empty set would be the same as 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: >>> return False >>>

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 complicated, but for example, zero is Fa

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 empty set, since they both wou

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 number is True. I thin

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 >> except: >> raise TypeError >

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 True That may or may not be a

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 >>>ht=__len__#object.__len__> >> As far as I c

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 where we can practice python programs for beginners and Intermediate. On Tuesday

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 a

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 of

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? -- https://mail.python.org/mailman/listinfo/pytho

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 the __bool__ method. Correct, bu

Re: Operator Precedence/Boolean Logic

2016-06-23 Thread Marko Rauhamaa
Lawrence D’Oliveiro : > On Thursday, June 23, 2016 at 9:11:05 PM UTC+12, Marko Rauhamaa wrote: >> The __len__ method is not guaranteed to execute in O(1). > > So what is? The __bool__ method is the appropriate place to implement an efficient emptiness check. It might not be O(1) but it will be th

Re: Break and Continue: While Loops

2016-06-23 Thread alister
On Wed, 22 Jun 2016 21:17:03 -0700, Elizabeth Weiss wrote: > CODE #1: > > i=0 while 1==1: >print(i) >i=i+1 if i>=5: > print("Breaking") break > > -- > I understand that i=0 and i will only be printed if 1=1 The results of > this is 0 > 1 > 2 > 3 > 4 > Breaking > > Why is Breaki

Re: Operator Precedence/Boolean Logic

2016-06-23 Thread Andreas Röhler
On 23.06.2016 11:17, Steven D'Aprano wrote: [ ... ] We can derive arithmetic from set theory. IMO not, resp. not really. But that would make a another item, pretty off-topic from Python. Should you know a place where to continue, would like to follow up. Thanks BTW. Zero is very speci

Re: Operator Precedence/Boolean Logic

2016-06-23 Thread Marko Rauhamaa
Steven D'Aprano : > On Thursday 23 June 2016 18:32, Andreas Röhler wrote: > >> There is a fundamental diff between zero and emptiness. > > In English, "emptiness" implies a container (real or figurative). The > container is not "something or nothing", it is the *contents* being > referred to. > >

Re: Operator Precedence/Boolean Logic

2016-06-23 Thread Lawrence D’Oliveiro
On Thursday, June 23, 2016 at 9:11:05 PM UTC+12, Marko Rauhamaa wrote: > Lawrence D’Oliveiro: > >> On Thursday, June 23, 2016 at 8:17:02 PM UTC+12, Marko Rauhamaa wrote: >>> if len(leftover) > 0:# no, I'd never write this >>> ... >> >> I regularly write “len(leftover) != 0”. Why no

Re: Operator Precedence/Boolean Logic

2016-06-23 Thread 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 a needlessly complicated rule. It would have been simple

Re: Operator Precedence/Boolean Logic

2016-06-23 Thread Antoon Pardon
Op 23-06-16 om 11:10 schreef Marko Rauhamaa: > Lawrence D’Oliveiro : > >> On Thursday, June 23, 2016 at 8:17:02 PM UTC+12, Marko Rauhamaa wrote: >>> if len(leftover) > 0:# no, I'd never write this >>> ... >> I regularly write “len(leftover) != 0”. Why not? > The __len__ method is no

Re: Operator Precedence/Boolean Logic

2016-06-23 Thread Antoon Pardon
Op 23-06-16 om 10:48 schreef Steven D'Aprano: > On Thursday 23 June 2016 18:17, Antoon Pardon wrote: > >> No zero is not nothing. > I think you have just disagreed with about four thousand years of > mathematicians and accountants. I don't care. In modern mathematics, zero is usaly defined as the

Re: Operator Precedence/Boolean Logic

2016-06-23 Thread Steven D'Aprano
On Thursday 23 June 2016 18:32, Andreas Röhler wrote: > There is a fundamental diff between zero and emptiness. In English, "emptiness" implies a container (real or figurative). The container is not "something or nothing", it is the *contents* being referred to. "This shopping bag is empty" doe

Re: Operator Precedence/Boolean Logic

2016-06-23 Thread Marko Rauhamaa
Lawrence D’Oliveiro : > On Thursday, June 23, 2016 at 8:17:02 PM UTC+12, Marko Rauhamaa wrote: >> if len(leftover) > 0:# no, I'd never write this >> ... > > I regularly write “len(leftover) != 0”. Why not? The __len__ method is not guaranteed to execute in O(1). See: https://d

Re: Request for opinions: A cross language development tool

2016-06-23 Thread Marko Rauhamaa
Laurent Pointal : > Tal Zion wrote: >> Bridge compiles Python modules into native code, > > What is "native", really microprocessor executable binary ? How do you > adapt to diversity? They don't need to adapt to different CPU types. They can list supported targets. Also, they could generate, sa

Re: Operator Precedence/Boolean Logic

2016-06-23 Thread Antoon Pardon
Op 23-06-16 om 10:16 schreef Marko Rauhamaa: > I don't particularly like Python's falsey/truthy semantics, but I can > live with it. The biggest problem I have with it is the absence of an > emptiness predicate. I'd like to be able to write: > > if not leftover.empty(): > ... > > or eve

Re: Operator Precedence/Boolean Logic

2016-06-23 Thread Lawrence D’Oliveiro
On Thursday, June 23, 2016 at 8:17:02 PM UTC+12, Marko Rauhamaa wrote: > if len(leftover) > 0:# no, I'd never write this > ... I regularly write “len(leftover) != 0”. Why not? -- https://mail.python.org/mailman/listinfo/python-list

Re: Operator Precedence/Boolean Logic

2016-06-23 Thread Steven D'Aprano
On Thursday 23 June 2016 18:17, Antoon Pardon wrote: > No zero is not nothing. I think you have just disagreed with about four thousand years of mathematicians and accountants. In fact, mathematicians were so hung up about zero being nothing, that it took about three thousand years before they

Re: Break and Continue: While Loops

2016-06-23 Thread Steven D'Aprano
On Thursday 23 June 2016 14:17, Elizabeth Weiss wrote: > CODE #2: > > i=0 > while True: >i=i+1 > if i==2: > print("Skipping 2") > continue > if i==5: > print("Breaking") > break >print(i) > > -- > > Questions: > 1. what does the word True have to do with anyt

Re: Operator Precedence/Boolean Logic

2016-06-23 Thread Andreas Röhler
On 23.06.2016 10:17, Antoon Pardon wrote: Op 23-06-16 om 09:05 schreef Steven D'Aprano: On Thursday 23 June 2016 16:34, Andreas Röhler wrote: Indeed, why should the result of 4 - 4 have a different truth-value than 4 - 3 ? Because 4-4 is zero, which is "nothing", while 4-3 is one, which is

Re: Operator Precedence/Boolean Logic

2016-06-23 Thread Andreas Röhler
On 23.06.2016 09:05, Steven D'Aprano wrote: On Thursday 23 June 2016 16:34, Andreas Röhler wrote: Indeed, why should the result of 4 - 4 have a different truth-value than 4 - 3 ? Because 4-4 is zero, which is "nothing", Hmm, water freezes at zero degree celsius, because there is no temper

Re: Operator Precedence/Boolean Logic

2016-06-23 Thread Marko Rauhamaa
Antoon Pardon : > It is why I have sometime found the need to write: > > if flag is True: > > Because flag needed to be True, not truthy. Then, you have found the correct idiom for your rare need. You might even want to consider: if flag is UP: ... elif flag is DOWN: ...

Re: Operator Precedence/Boolean Logic

2016-06-23 Thread Antoon Pardon
Op 23-06-16 om 09:05 schreef Steven D'Aprano: > On Thursday 23 June 2016 16:34, Andreas Röhler wrote: > >> Indeed, why should the result of 4 - 4 have a different truth-value than >> 4 - 3 ? > Because 4-4 is zero, which is "nothing", while 4-3 is one, which is > "something". No zero is not nothin

Re: Operator Precedence/Boolean Logic

2016-06-23 Thread Antoon Pardon
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 a needlessly complicated rule. It would have been simpler >>> if boolean operators (and conditional expressions like

Re: Request for opinions: A cross language development tool

2016-06-23 Thread Laurent Pointal
Tal Zion wrote: > Bridge compiles Python modules into native code, What is "native", really microprocessor executable binary ? How do you adapt to diversity? > which requires us to > support Python *language* features (for, while, class, generators, etc) > but it reuses CPython's libraries (li

Re: Operator Precedence/Boolean Logic

2016-06-23 Thread Steven D'Aprano
On Thursday 23 June 2016 14:47, Lawrence D’Oliveiro wrote: > On Thursday, June 23, 2016 at 3:12:52 PM UTC+12, Larry Hudson wrote: >> On 06/22/2016 12:42 AM, Lawrence D’Oliveiro wrote: >>> * boolean operators don’t have to operate on boolean values. The >>> language spec >>>

Re: Operator Precedence/Boolean Logic

2016-06-23 Thread Christian Gollwitzer
Am 23.06.16 um 05:12 schrieb Larry Hudson: On 06/22/2016 12:42 AM, Lawrence D’Oliveiro wrote: I feel that’s a needlessly complicated rule. It would have been simpler if boolean operators (and conditional expressions like in if-statements and while-statements) only allowed values of boolean types

Re: Operator Precedence/Boolean Logic

2016-06-23 Thread Steven D'Aprano
On Thursday 23 June 2016 16:34, Andreas Röhler wrote: > Indeed, why should the result of 4 - 4 have a different truth-value than > 4 - 3 ? Because 4-4 is zero, which is "nothing", while 4-3 is one, which is "something". You might as well ask why False and True have different truth values. Iron