Re: test-ignore

2024-02-18 Thread Science Researcher via Python-list
"Lawrence D'Oliveiro" wrote in message news:uqrik4$lrc1$1...@dont-email.me... On Sat, 17 Feb 2024 17:00:59 -0600, Science Researcher wrote: "Lawrence D'Oliveiro" wrote in message news:uqmbp3$3hsa6$1...@dont-email.me... If I remember correctly, I had to get the installation program

Re: test-ignore

2024-02-16 Thread Grizzy Adams via Python-list
Thursday, February 15, 2024 at 16:02, Tony Oliver via Python-list wrote: Re: test-ignore (at least in part) >On Thursday 15 February 2024 at 21:16:22 UTC, E.D.G. wrote: >> Test - ignore February 15, 2024 >> >> Test post to see if my Newsgroup post program is working. >

Re: test-ignore

2024-02-15 Thread Skip Montanaro via Python-list
> > True, but did the poster really need to send another one to say "yes, > that worked"? > Maybe to test the bidirectionality of the gateway? 🤷 If the messages stop I think we can let it die. It's not like this sort of activity is a regular occurrence. (A bigger problem for me was always Usenet p

Re: test-ignore

2024-02-15 Thread MRAB via Python-list
On 2024-02-16 00:29, Skip Montanaro via Python-list wrote: > Test post to see if my Newsgroup post program is working. Aim your test messages at alt.test, please. I agree that basic Usenet connectivity messages should go to alt.test. It's not clear from the original post, but if the poster's

Re: test-ignore

2024-02-15 Thread dn via Python-list
On 16/02/24 13:29, Skip Montanaro via Python-list wrote: Test post to see if my Newsgroup post program is working. Aim your test messages at alt.test, please. I agree that basic Usenet connectivity messages should go to alt.test. It's not clear from the original post, but if the poster's a

Re: test-ignore

2024-02-15 Thread Skip Montanaro via Python-list
> > > Test post to see if my Newsgroup post program is working. > > Aim your test messages at alt.test, please. > I agree that basic Usenet connectivity messages should go to alt.test. It's not clear from the original post, but if the poster's aim was to see if posts to comp.lang.python traverse t

Re: test-ignore

2024-02-15 Thread Tony Oliver via Python-list
On Thursday 15 February 2024 at 21:16:22 UTC, E.D.G. wrote: > Test - ignore February 15, 2024 > > Test post to see if my Newsgroup post program is working. Aim your test messages at alt.test, please. -- https://mail.python.org/mailman/listinfo/python-list

Re: test ignore

2024-02-15 Thread Science Researcher via Python-list
"Science Researcher" wrote in message news:fh2dnwrca5oedvp4nz2dnzfqnpwdn...@earthlink.com... This is a test message - just ignore it That post worked as intended. -- https://mail.python.org/mailman/listinfo/python-list

Re: test

2023-03-07 Thread dn via Python-list
On 08/03/2023 11.48, Jim Byrnes wrote: haven't received anything from the list for quite awhile. Got no response when I tried to contact the administrator. ACK -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list

Re: Test before PR

2018-10-10 Thread Abdur-Rahmaan Janhangeer
ok, thank you! Abdur-Rahmaan Janhangeer https://github.com/Abdur-rahmaanJ Mauritius -- https://mail.python.org/mailman/listinfo/python-list

Re: Test before PR

2018-10-09 Thread Rhodri James
On 09/10/18 11:07, Abdur-Rahmaan Janhangeer wrote: just a simple question. how do you test PR before merge? I doubt there's a single answer to that question. Some things like documentation changes can just be read, code reviews might work for sufficiently small changes, and so on. If you hav

Re: test for absence of infinite loop

2018-07-17 Thread dieter
Robin Becker writes: > A user reported an infinite loop in reportlab. I determined a possible > cause and fix and would like to test for absence of the loop. Is there > any way to check for presence/absence of an infinite loop in python? I > imagine we could do something like call an external proc

Re: test for absence of infinite loop

2018-07-17 Thread Cameron Simpson
On 17Jul2018 12:39, Robin Becker wrote: On 17/07/2018 12:16, Cameron Simpson wrote: On 17Jul2018 10:10, Robin Becker wrote: A user reported an infinite loop in reportlab. I determined a possible cause and fix and would like to test for absence of the loop. Is there any way to check for prese

Re: test for absence of infinite loop

2018-07-17 Thread Terry Reedy
On 7/17/2018 7:39 AM, Robin Becker wrote: well I understand the problem about not halting. However as you point out in a fixed case I know that the test should take fractions of a second to complete. If nothing else, you can easily add def test_xyz_completes(self): xyz(args) # Forme

Re: test for absence of infinite loop

2018-07-17 Thread Alister via Python-list
On Tue, 17 Jul 2018 10:10:49 +0100, Robin Becker wrote: > A user reported an infinite loop in reportlab. I determined a possible > cause and fix and would like to test for absence of the loop. Is there > any way to check for presence/absence of an infinite loop in python? I > imagine we could do s

Re: test for absence of infinite loop

2018-07-17 Thread Steven D'Aprano
On Tue, 17 Jul 2018 10:10:49 +0100, Robin Becker wrote: > A user reported an infinite loop in reportlab. I determined a possible > cause and fix and would like to test for absence of the loop. Is there > any way to check for presence/absence of an infinite loop in python? I > imagine we could do s

Re: test for absence of infinite loop

2018-07-17 Thread Robin Becker
On 17/07/2018 12:16, Cameron Simpson wrote: On 17Jul2018 10:10, Robin Becker wrote: A user reported an infinite loop in reportlab. I determined a possible cause and fix and would like to test for absence of the loop. Is there any way to check for presence/absence of an infinite loop in python?

Re: test for absence of infinite loop

2018-07-17 Thread Cameron Simpson
On 17Jul2018 10:10, Robin Becker wrote: A user reported an infinite loop in reportlab. I determined a possible cause and fix and would like to test for absence of the loop. Is there any way to check for presence/absence of an infinite loop in python? I imagine we could do something like call a

Re: test for absence of infinite loop

2018-07-17 Thread Robin Becker
On 17/07/2018 10:32, Chris Angelico wrote: .. All you gotta do is solve the halting problem... https://en.wikipedia.org/wiki/Halting_problem ChrisA ah so it's easy :) -- Robin Becker -- https://mail.python.org/mailman/listinfo/python-list

Re: test for absence of infinite loop

2018-07-17 Thread Chris Angelico
On Tue, Jul 17, 2018 at 7:10 PM, Robin Becker wrote: > A user reported an infinite loop in reportlab. I determined a possible cause > and fix and would like to test for absence of the loop. Is there any way to > check for presence/absence of an infinite loop in python? I imagine we could > do some

Re: test

2018-03-12 Thread Yuan Xue
Alister writes: > On Mon, 12 Mar 2018 13:43:01 -0500, Yuan Xue wrote: > >> test > > failed Funny, I am wodering what type of persons are still using this clumsy system, and their purposes of using it. -- https://mail.python.org/mailman/listinfo/python-list

Re: test

2018-03-12 Thread Cameron Simpson
On 17Mar2014 11:42, Mark H Harris wrote: On 3/16/14 5:07 AM, Chris “Kwpolska” Warrick wrote: Why not use the mailing list instead? It’s a much easier way to access this place. I prefer to 'pull' rather than receive the 'push'. The newsreader idea is better because threading works better, an

Re: test

2018-03-12 Thread Alister via Python-list
On Mon, 12 Mar 2018 13:43:01 -0500, Yuan Xue wrote: > test failed -- Mollison's Bureaucracy Hypothesis: If an idea can survive a bureaucratic review and be implemented it wasn't worth doing. -- https://mail.python.org/mailman/listinfo/python-list

Re: Test - please ignore (again)

2017-11-19 Thread Skip Montanaro
> Another test of SpamBayes in comp.lang.python -> python-list gateway. Still leaning on the submit button to see what gate_news thinks... Skip -- https://mail.python.org/mailman/listinfo/python-list

Re: Test - you can ignore

2017-11-18 Thread Skip Montanaro
On Saturday, November 18, 2017 at 7:28:56 AM UTC-6, Skip Montanaro wrote: > This is a test posting from the Usenet side of things. Looking to see if/when > it turns up in the gate_news logs on mail.python.org... > > Skip Yet another test. This time with SpamBayes x-mine_usenet_headers setting e

Re: Test - you can ignore

2017-11-18 Thread Skip Montanaro
On Saturday, November 18, 2017 at 7:28:56 AM UTC-6, Skip Montanaro wrote: > This is a test posting from the Usenet side of things. Looking to see if/when > it turns up in the gate_news logs on mail.python.org... This is another test, though with a bit more Python content... (python2) ~% python -

Re: Test Bank for Entrepreneurship The Practice and Mindset 1st Edition by Neck

2017-10-26 Thread salaboud
On Saturday, July 1, 2017 at 1:36:10 PM UTC-4, Test Banks wrote: > Greetings, > > You can get Test Bank for " Entrepreneurship The Practice and Mindset 1st > Edition by Neck " at very reasonable price. Our team is available 24/7 and > 365 days / year to respond your requests. Send us an email a

Re: Test Bank for Campbell Biology 11th Edition by Urry, Cain

2017-10-17 Thread ihamidx0
On Wednesday, September 27, 2017 at 5:52:23 PM UTC-4, Test Banks wrote: > Greetings, > > You can get Test Bank for " Campbell Biology, 11 Edition by Lisa A. > Urry,Michael L. Cain,Steven A. Wasserman,Peter V. Minorsky,Jane B. Reece " at > very reasonable price. Our team is available 24/7 and 36

Re: Test Bank for Introduction to Sociology 10th Edition by Anthony Giddens

2017-10-11 Thread keishbby
On Wednesday, July 12, 2017 at 5:15:39 PM UTC-4, Test Banks wrote: > Greetings, > > You can get Test Bank for " Introduction to Sociology 10th Edition by Anthony > Giddens, Mitchell Duneier, Richard P. Appelbaum, Deborah Carr " at very > reasonable price. Our team is available 24/7 and 365 days

Re: Test Bank for Management, Operations Management, Supply Chain Management, Project Management for all editions

2017-09-21 Thread louisacorey
Organizational Behavior and Management, 11th Edition by Robert Konopaske and John Ivancevich and Michael Matteson -- https://mail.python.org/mailman/listinfo/python-list

Re: Test Bank for Governing Texas, 3rd Edition by Champagne Harpham

2017-09-17 Thread alister via Python-list
> > > I am interested in the testbank for this book. What is the price ? Don't encourage spammers -- California, n.: From Latin "calor", meaning "heat" (as in English "calorie" or Spanish "caliente"); and "fornia'" for "sexual intercourse" or "fornication." Hence: Tierra de California, "

Re: Test Bank for Governing Texas, 3rd Edition by Champagne Harpham

2017-09-15 Thread andrey . estrada2
On Sunday, July 9, 2017 at 5:58:45 AM UTC-6, Test Banks wrote: > Greetings, > > You can get Test Bank for " Governing Texas, 3rd Edition by Anthony > Champagne, Edward J. Harpham, Jason P. Casellas " at very reasonable price. > Our team is available 24/7 and 365 days / year to respond your requ

Re: Test Bank for Essentials of Sociology 6th Edition by Basirico

2017-08-25 Thread candyrainey
On Wednesday, July 12, 2017 at 5:05:41 PM UTC-4, Test Banks wrote: > Greetings, > > You can get Test Bank for " Essentials of Sociology 6th Edition by Richard P. > Appelbaum, Deborah Carr, Mitchell Duneier, Anthony Giddens " at very > reasonable price. Our team is available 24/7 and 365 days /

Re: Test 0 and false since false is 0

2017-07-12 Thread Terry Reedy
On 7/12/2017 7:35 AM, Rhodri James wrote: On 12/07/17 03:29, Stefan Ram wrote: Grant Edwards writes: False is required to be a singleton. »singleton« usually means »the sole object of its class«. »Ensure a class only has one instance, and provide a global point of access to

Re: Test 0 and false since false is 0

2017-07-12 Thread Rhodri James
On 12/07/17 03:29, Stefan Ram wrote: Grant Edwards writes: False is required to be a singleton. »singleton« usually means »the sole object of its class«. »Ensure a class only has one instance, and provide a global point of access to it.« - Gamma et al. We are using the ter

Re: Test 0 and false since false is 0

2017-07-11 Thread Steve D'Aprano
On Tue, 11 Jul 2017 11:16 pm, Albert-Jan Roskam wrote: > >>> False == 0 > True > >>> False is 0 > False > > > => Just wondering: Is this 'is' test depending on an implementation detail > of cPython (small ints, I forgot how small 0-255 maybe, are singletons)? No. But the test 0 is 0 will b

Re: Test 0 and false since false is 0

2017-07-11 Thread Grant Edwards
On 2017-07-11, Albert-Jan Roskam wrote: > From: Python-list on > behalf of Dan Sommers > Sent: Friday, July 7, 2017 2:46 AM > To: python-list@python.org > Subject: Re: Test 0 and false since false is 0 >   > On Thu, 06 Jul 2017 19:29:00 -0700, Sayth Renshaw wrote:

Re: Test 0 and false since false is 0

2017-07-11 Thread Rhodri James
On 11/07/17 14:16, Albert-Jan Roskam wrote: From: Python-list on behalf of Dan Sommers Sent: Friday, July 7, 2017 2:46 AM To: python-list@python.org Subject: Re: Test 0 and false since false is 0 On Thu, 06 Jul 2017 19:29:00 -0700, Sayth Renshaw wrote: I have tried or conditions of v

Re: Test 0 and false since false is 0

2017-07-11 Thread Albert-Jan Roskam
From: Python-list on behalf of Dan Sommers Sent: Friday, July 7, 2017 2:46 AM To: python-list@python.org Subject: Re: Test 0 and false since false is 0   On Thu, 06 Jul 2017 19:29:00 -0700, Sayth Renshaw wrote: > I have tried or conditions of v == False etc but then the 0's being

Re: Test 0 and false since false is 0

2017-07-10 Thread Grant Edwards
On 2017-07-09, Paul D. DeRocco wrote: >> From: Sayth Renshaw >> >> I have been reading this solution >> > >>> after = sorted(before, key=lambda x: x == 0 and type(x) == int) >> >> it is really good, however I don't understand it enough to >> reimplement something like that myself yet. >> >> T

RE: Test 0 and false since false is 0

2017-07-08 Thread Paul D. DeRocco
> From: Sayth Renshaw > > I have been reading this solution > > >>> after = sorted(before, key=lambda x: x == 0 and type(x) == int) > > it is really good, however I don't understand it enough to > reimplement something like that myself yet. > > Though I can that lambda tests for 0 that is equa

Re: Test 0 and false since false is 0

2017-07-08 Thread Sayth Renshaw
> Another option is to test for type(value) == int: > > >>> before = ["a",0,0,"b",None,"c","d",0,1,False,0,1,0,3,[],0,1,9,0,0, > {},0,0,9] > >>> wanted = ["a","b",None,"c","d",1,False,1,3,[],1,9, > {},9,0,0,0,0,0,0,0,0,0,0] > >>> after = sorted(before, key=lambda x: x == 0 and type(x) == int) > >

Re: Test 0 and false since false is 0

2017-07-07 Thread Peter Otten
Nathan Ernst wrote: > On Fri, Jul 7, 2017 at 2:04 AM, Peter Otten <__pete...@web.de> wrote: >> >>> sorted([0.0, 0, False, [], "x"], key=lambda x: x == 0 and type(x) == >> int) >> [0.0, False, [], 'x', 0] > You'd be better off using the builtin "isinstance" function, e.g.: > isinstance(x, int). T

Re: Test 0 and false since false is 0

2017-07-07 Thread Nathan Ernst
You'd be better off using the builtin "isinstance" function, e.g.: isinstance(x, int). This also has the added benefit of working nicely with inheritance (isinstance returns true if the actual type is derived from the classinfo passed as the second argument). See https://docs.python.org/3/library/f

Re: Test 0 and false since false is 0

2017-07-07 Thread Grant Edwards
On 2017-07-07, Stefan Ram wrote: > Sayth Renshaw writes: >>I have tried or conditions of v == False etc but then the 0's >>being false also aren't moved. How can you check this at >>once? > > »The Boolean type is a subtype of the integer type, and > Boolean values behave like the valu

Re: Test 0 and false since false is 0

2017-07-07 Thread zhenghao li
you can use the "is" for identity test. l1 = [v for v in array if not v is 0] l2 = [v for v in array if v is 0] On Jul 6, 2017, at 10:31 PM, Sayth Renshaw mailto:flebber.c...@gmail.com>> wrote: I was trying to solve a problem and cannot determine how to filter 0's but not false. Given a list l

RE: Test 0 and false since false is 0

2017-07-07 Thread Paul D. DeRocco
> From: Dan Sommers > > > On Thu, 06 Jul 2017 19:29:00 -0700, Sayth Renshaw wrote: > > > > I have tried or conditions of v == False etc but then the 0's being > > false also aren't moved. How can you check this at once? > > Maybe this will help: > > Python 3.5.3+ (default, Jun 7 2017, 23:2

Re: Test 0 and false since false is 0

2017-07-07 Thread Peter Otten
Sayth Renshaw wrote: > I was trying to solve a problem and cannot determine how to filter 0's but > not false. > > Given a list like this > ["a",0,0,"b",None,"c","d",0,1,False,0,1,0,3,[],0,1,9,0,0,{},0,0,9] > > I want to be able to return this list > ["a","b",None,"c","d",1,False,1,3,[],1,9,{},9

Re: Test 0 and false since false is 0

2017-07-06 Thread Rick Johnson
On Thursday, July 6, 2017 at 9:57:43 PM UTC-5, Skip Montanaro wrote: > I was trying to solve a problem and cannot determine how to filter 0's but > not false. > > > I'm typing on my phone so can't paste a session [...] I have not tried any for myself, but there are a few Python installations avail

Re: Test 0 and false since false is 0

2017-07-06 Thread Rick Johnson
On Thursday, July 6, 2017 at 10:00:36 PM UTC-5, Sayth Renshaw wrote: > Is there an "is not" method that's not != so I can check is not false. Maybe. Or maybe /not/. :-P" One way to find out would be to fire up your python interpretor, and do some interactive testing. Here, allow me to cinge my ey

Re: Test 0 and false since false is 0

2017-07-06 Thread Sayth Renshaw
On Friday, 7 July 2017 12:46:51 UTC+10, Rick Johnson wrote: > On Thursday, July 6, 2017 at 9:29:29 PM UTC-5, Sayth Renshaw wrote: > > I was trying to solve a problem and cannot determine how to filter 0's but > > not false. > > > > Given a list like this > > ["a",0,0,"b",None,"c","d",0,1,False,0

Re: Test 0 and false since false is 0

2017-07-06 Thread Dan Sommers
On Fri, 07 Jul 2017 02:48:45 +, Stefan Ram wrote: def isfalse( x ): > ... return x == 0 and str( type( x )) == "" > ... > Don't depend on string representations of objects, unless you know what you're doing. Do this instead: def isfalse(x): return x == 0 and type(x) is b

Re: Test 0 and false since false is 0

2017-07-06 Thread Skip Montanaro
I was trying to solve a problem and cannot determine how to filter 0's but not false. I'm typing on my phone so can't paste a session, so I will attempt to apply the Socratic method, and ask: Do you understand why your attempts have failed so far? In what way are False and 0 the same? In what res

Re: Test 0 and false since false is 0

2017-07-06 Thread Dan Sommers
On Thu, 06 Jul 2017 19:29:00 -0700, Sayth Renshaw wrote: > I have tried or conditions of v == False etc but then the 0's being > false also aren't moved. How can you check this at once? Maybe this will help: Python 3.5.3+ (default, Jun 7 2017, 23:23:48) [GCC 6.3.0 20170516] on linux

Re: Test 0 and false since false is 0

2017-07-06 Thread Rick Johnson
On Thursday, July 6, 2017 at 9:29:29 PM UTC-5, Sayth Renshaw wrote: > I was trying to solve a problem and cannot determine how to filter 0's but > not false. > > Given a list like this > ["a",0,0,"b",None,"c","d",0,1,False,0,1,0,3,[],0,1,9,0,0,{},0,0,9] > > I want to be able to return this list

Re: Test String Contents

2017-06-13 Thread Peter Otten
Peter Otten wrote: > Matt wrote: > >> What is easiest way to determine if a string ONLY contains a-z upper >> or lowercase. I also want to allow the "-" and "_" symbols. No >> spaces or anything else. > > If you don't know regular expressions here's a method where not much can > go wrong: ...

Re: Test String Contents

2017-06-13 Thread Thomas Nyberg
On 06/13/2017 03:34 PM, Matt wrote: > What is easiest way to determine if a string ONLY contains a-z upper > or lowercase. I also want to allow the "-" and "_" symbols. No > spaces or anything else. > I'm not sure it's the best way, but the following seems okay: >>> s = 'hello_world' >>> s.repl

Re: Test String Contents

2017-06-13 Thread Peter Otten
Matt wrote: > What is easiest way to determine if a string ONLY contains a-z upper > or lowercase. I also want to allow the "-" and "_" symbols. No > spaces or anything else. If you don't know regular expressions here's a method where not much can go wrong: >>> import string >>> acceptable =

Re: Test to see if message is bounced

2017-06-01 Thread Chris Angelico
On Fri, Jun 2, 2017 at 3:44 AM, Richard Moseley wrote: > Apologies if this appears on the list, but I'm checking whether I have been > placed onto a blacklist since previous postings have been bounced back with > an error that the email address is not on the "subscribers list". I > previously had

Re: Test if Script Already Running

2017-04-20 Thread Marko Rauhamaa
Jon Ribbens : > On 2017-04-20, Cameron Simpson wrote: >> For myself, I like mkdir. It is portable. It is atomic. It fails if >> the target exists. It works over NFS etc. It is easy. >> >> os.mkdir('lock') >> ... do stuff ... >> os.rmdir('lock') > > One downside to this is that if the proce

Re: Test if Script Already Running

2017-04-20 Thread Jon Ribbens
On 2017-04-20, Cameron Simpson wrote: > Others have pointed the way to an exact implementation. > > For myself, I like mkdir. It is portable. It is atomic. It fails if > the target exists. It works over NFS etc. It is easy. > > os.mkdir('lock') > ... do stuff ... > os.rmdir('lock') One dow

Re: Test if Script Already Running

2017-04-19 Thread Cameron Simpson
On 18Apr2017 19:31, Matt wrote: I have a number of simple scripts I run with cron hourly on Centos linux. I want the script to check first thing if its already running and if so exit. In perl I did it with this at the start of every script: use Fcntl ':flock'; INIT { open LH, $0

Re: Test if Script Already Running

2017-04-18 Thread Jon Ribbens
On 2017-04-19, Matt wrote: > I have a number of simple scripts I run with cron hourly on Centos > linux. I want the script to check first thing if its already running > and if so exit. > > In perl I did it with this at the start of every script: > > use Fcntl ':flock'; > INIT { >

Re: Test if Script Already Running

2017-04-18 Thread Erik
On 19/04/17 01:31, Matt wrote: In perl I did it with this at the start of every script: use Fcntl ':flock'; [snip] How can I do something like this in Python? >>> import fcntl >>> help(fcntl.flock) E. -- https://mail.python.org/mailman/listinfo/python-list

Re: test post please ignore

2016-04-08 Thread Ethan Furman
On 04/08/2016 06:32 PM, Random832 wrote: Testing posting from an email address other than the one I'm subscribed in, to determine whether it's possible to post to the list without being subscribed. Kinda. :) -- ~Ethan~ -- https://mail.python.org/mailman/listinfo/python-list

Re: (test) ? a:b

2014-10-27 Thread Gregory Ewing
Michael Torrie wrote: As far as I can tell, no BASIC dialect I've looked at (DOS and Linux worlds only), has ever had any logical operators like AND (&&), OR (||), and NOT (!). They only appear to have bitwise operators (&,|,~ C equivalent). The fact that comparison operators returned 0 and -1

Re: (test) ? a:b

2014-10-27 Thread ast
"Mark Lawrence" a écrit dans le message de news:mailman.15070.1413978605.18130.python-l...@python.org... Also would you please access this list via https://mail.python.org/mailman/listinfo/python-list or read and action this https://wiki.python.org/moin/GoogleGroupsPython to prevent us seein

Re: (test) ? a:b

2014-10-26 Thread Ben Finney
Joshua Landau writes: > On 27 October 2014 02:28, Ben Finney wrote: > > Guido is incorrect. I've already stated what's wrong. > > You were arguing about what Guido thinks. I don't know where I did that; to my knowledge, this is the first time I've mentioned Guido, and it's in rebuttal to his au

Re: (test) ? a:b

2014-10-26 Thread Joshua Landau
On 27 October 2014 02:28, Ben Finney wrote: > Joshua Landau writes: > >> Guido van Rossum answered Jul 28 '11 at 21:20, >> http://stackoverflow.com/questions/3174392/is-it-pythonic-to-use-bools-as-ints >> > False==0 and True==1, and there's nothing wrong with that. > > Guido is incorrect. I've al

Re: (test) ? a:b

2014-10-26 Thread Rustom Mody
On Monday, October 27, 2014 7:59:04 AM UTC+5:30, Ben Finney wrote: > Joshua Landau writes: > > > Guido van Rossum answered Jul 28 '11 at 21:20, > > http://stackoverflow.com/questions/3174392/is-it-pythonic-to-use-bools-as-ints > > > False==0 and True==1, and there's nothing wrong with that. > > G

Re: (test) ? a:b

2014-10-26 Thread Ben Finney
Joshua Landau writes: > Guido van Rossum answered Jul 28 '11 at 21:20, > http://stackoverflow.com/questions/3174392/is-it-pythonic-to-use-bools-as-ints > > False==0 and True==1, and there's nothing wrong with that. Guido is incorrect. I've already stated what's wrong. That's different from sayi

Re: (test) ? a:b

2014-10-26 Thread Rustom Mody
On Sunday, October 26, 2014 9:45:22 AM UTC+5:30, Steven D'Aprano wrote: > http://legacy.python.org/dev/peps/pep-0285/ > Ben Finney wrote: > > > > I agree with the decision, because this isn't an issue which often leads > > to *incorrect* code. But I maintain that it's an unfortunate and > > need

Re: (test) ? a:b

2014-10-26 Thread Joshua Landau
On 26 October 2014 01:03, Ben Finney wrote: > Steven D'Aprano writes: > >> I suspect that Guido and the core developers disagree with you, since >> they had the opportunity to fix that in Python 3 and didn't. > > That doesn't follow; there are numerous warts in Python 2 that were not > fixed in P

Re: (test) ? a:b

2014-10-26 Thread MRAB
On 2014-10-27 00:38, Ben Finney wrote: Steven D'Aprano writes: Do you really not see the connection between counting and summing? Connection? Of course. But I also see a huge distinction. I'm surprised you could misunderstand my position to the extent you think such a question needs to be as

Re: (test) ? a:b

2014-10-26 Thread Ben Finney
Steven D'Aprano writes: > Do you really not see the connection between counting and summing? Connection? Of course. But I also see a huge distinction. I'm surprised you could misunderstand my position to the extent you think such a question needs to be asked. The difference between “sum these v

Re: (test) ? a:b

2014-10-26 Thread Terry Reedy
On 10/26/2014 12:15 AM, Steven D'Aprano wrote: Ben Finney wrote: Steven D'Aprano writes: I suspect that Guido and the core developers disagree with you, since they had the opportunity to fix that in Python 3 and didn't. That doesn't follow; there are numerous warts in Python 2 that were no

Re: Test driven programming, was Re: VB to Python migration

2014-10-26 Thread Viorica Gheorghiu
-- https://mail.python.org/mailman/listinfo/python-list

Re: (test) ? a:b

2014-10-25 Thread Chris Angelico
On Sun, Oct 26, 2014 at 3:15 PM, Steven D'Aprano wrote: > Since the list items exist only to be counted, the actual item used makes no > difference. You could use any value at all, or even a different value each > time: > > len([random.random() for line in lines if not line.strip()]) > > What

Re: (test) ? a:b

2014-10-25 Thread Steven D'Aprano
Ben Finney wrote: > Steven D'Aprano writes: > >> I suspect that Guido and the core developers disagree with you, since >> they had the opportunity to fix that in Python 3 and didn't. > > That doesn't follow; there are numerous warts in Python 2 that were not > fixed in Python 3. As I understan

Re: (test) ? a:b

2014-10-25 Thread Michael Torrie
On 10/25/2014 07:20 PM, Chris Angelico wrote: > So don't use Python idioms in BASIC. :) Back when I used to write > BASIC code, I'd do explicit comparisons with zero for this sort of > thing... these days, I'd use Python idioms, but I'd also write Python > code :) > > I think it's indicative that

Re: (test) ? a:b

2014-10-25 Thread Chris Angelico
On Sun, Oct 26, 2014 at 12:04 PM, Michael Torrie wrote: > But you can run > into trouble if you tried to use a common python idiom like this: > > x = read_some_lines() 'returns number of lines read, or zero if none are > if not x: > print ("I couldn't read any lines") > exit(1) > >

Re: (test) ? a:b

2014-10-25 Thread Ben Finney
Ben Finney writes: > This is short and clear and needs no leaking of the underlying bool > implementation:: > > len(True for line in lines if line.strip()) Correction:: len([True for line in lines if line.strip()]) -- \ “Our task must be to free ourselves from our prison by widen

Re: (test) ? a:b

2014-10-25 Thread Michael Torrie
On 10/22/2014 09:46 PM, Gregory Ewing wrote: > Chris Angelico wrote: >> I've seen much MUCH worse... where multiple conditional >> expressions get combined arithmetically, and then the result used >> somewhere... > > In the days of old-school BASIC it was common to > exploit the fact that boolean

Re: (test) ? a:b

2014-10-25 Thread Ben Finney
Steven D'Aprano writes: > I suspect that Guido and the core developers disagree with you, since > they had the opportunity to fix that in Python 3 and didn't. That doesn't follow; there are numerous warts in Python 2 that were not fixed in Python 3. As I understand it, the preservation of bool–i

Re: (test) ? a:b

2014-10-25 Thread Steven D'Aprano
Ben Finney wrote: > Steven D'Aprano writes: > >> Of course it won't be clear to *everyone* but it should be clear >> enough to people who are familiar with standard Python idioms. A >> concrete example should be more obvious than the fake example: >> >> title = ('Mr', 'Ms')[person.sex == 'F'] >>

Re: (test) ? a:b

2014-10-25 Thread Chris Angelico
On Sun, Oct 26, 2014 at 11:09 AM, Mark Lawrence wrote: > Horrible IMHO, it just doesn't fit in my mind set. Still each to their own. Yeah, the comprehension version is way more explicit (though it probably ought to be a set and a set comp, not a tuple and a list comp), and not as good, IMO. But

Re: (test) ? a:b

2014-10-25 Thread Mark Lawrence
On 26/10/2014 01:01, Chris Angelico wrote: On Sun, Oct 26, 2014 at 10:53 AM, Ben Finney wrote: Dan Stromberg writes: EG, if I have 3 mutually exclusive command line options, I'll do something like: if option_a + option_b + option_c != 1: sys.stderr.write('{}: -a, -b and -c are mutually

Re: (test) ? a:b

2014-10-25 Thread Chris Angelico
On Sun, Oct 26, 2014 at 10:53 AM, Ben Finney wrote: > Dan Stromberg writes: > >> EG, if I have 3 mutually exclusive command line options, I'll do >> something like: >> >> if option_a + option_b + option_c != 1: >>sys.stderr.write('{}: -a, -b and -c are mutually >> exclusive\n'.format(sys.arg

Re: (test) ? a:b

2014-10-25 Thread Ben Finney
Dan Stromberg writes: > EG, if I have 3 mutually exclusive command line options, I'll do > something like: > > if option_a + option_b + option_c != 1: >sys.stderr.write('{}: -a, -b and -c are mutually > exclusive\n'.format(sys.argv[0])) That is an excellent illustration of why exploiting th

Re: (test) ? a:b

2014-10-25 Thread Dan Stromberg
On Sat, Oct 25, 2014 at 1:45 PM, Ben Finney wrote: > Steven D'Aprano writes: >> title = ('Mr', 'Ms')[person.sex == 'F'] >> >> which should be clear to anyone who understands indexing in Python and >> that True == 1 and False == 0. > > I consider it an accident of history, and one which should not

Re: (test) ? a:b

2014-10-25 Thread Ben Finney
Steven D'Aprano writes: > Of course it won't be clear to *everyone* but it should be clear > enough to people who are familiar with standard Python idioms. A > concrete example should be more obvious than the fake example: > > title = ('Mr', 'Ms')[person.sex == 'F'] > > which should be clear to a

Re: (test) ? a:b

2014-10-25 Thread alister
On Sat, 25 Oct 2014 16:03:16 +1100, Steven D'Aprano wrote: > [Alister] >> I had to mentally step through this before it became apparent what it >> was doing, can see places where it could be usefull (a switch >> replacement) but it is not instantly obvious > > Very little code is instantly obvio

Re: (test) ? a:b

2014-10-25 Thread Ian Kelly
On Sat, Oct 25, 2014 at 5:58 AM, Ned Batchelder wrote: > You mention "standard Python idioms." I think this style of > conditional-via-indexing is becoming quite uncommon, and is no longer one of > the standard Python idioms. This is now in the category of "outdated hack." I think that's probab

Re: (test) ? a:b

2014-10-25 Thread Ned Batchelder
On 10/25/14 1:03 AM, Steven D'Aprano wrote: alister wrote: >On Fri, 24 Oct 2014 10:20:30 -0700, Dan Stromberg wrote: > >>On Fri, Oct 24, 2014 at 1:38 AM, Steven D'Aprano >> wrote: >>>I don't get why that's considered hard to read. >> >>>So why is it hard to read when the index is a flag? >

Re: (test) ? a:b

2014-10-24 Thread Chris Angelico
On Sat, Oct 25, 2014 at 4:03 PM, Steven D'Aprano wrote: > Ha! And yet people have, and continue to, complain *bitterly* about the > non-standard ordering of Python's ternary if, compared to C, standard > if...else syntax, and English. > > "If the syntax is like C, then people will use it, or else

Re: (test) ? a:b

2014-10-24 Thread Steven D'Aprano
alister wrote: > On Fri, 24 Oct 2014 10:20:30 -0700, Dan Stromberg wrote: > >> On Fri, Oct 24, 2014 at 1:38 AM, Steven D'Aprano >> wrote: >>> I don't get why that's considered hard to read. >> >>> So why is it hard to read when the index is a flag? >>> >>> value = [f, g][cond]() >> [Dan] >> It

Re: (test) ? a:b

2014-10-24 Thread Marko Rauhamaa
alister : > a = if else > > is instantly obvious (at least to a native English speaker anyway) And you can go further down that road. For example, you could say things like: die unless everything is OK Marko -- https://mail.python.org/mailman/listinfo/python-list

Re: (test) ? a:b

2014-10-24 Thread alister
On Fri, 24 Oct 2014 10:20:30 -0700, Dan Stromberg wrote: > On Fri, Oct 24, 2014 at 1:38 AM, Steven D'Aprano > wrote: >> I don't get why that's considered hard to read. > >> So why is it hard to read when the index is a flag? >> >> value = [f, g][cond]() > > It's clear to you, it's clear to me,

Re: (test) ? a:b

2014-10-24 Thread Marko Rauhamaa
Ian Kelly : >> j = (lambda: 3, lambda: j + 1)[j < 10]() > Yes, the lambda approach falls victim to function calls being slow. That's just a deficiency in the compiler. There's nothing there that prevents the optimizer from translating the expression into the equivalent if statement. At any

Re: (test) ? a:b

2014-10-24 Thread Tobiah
On 10/24/2014 10:27 AM, Chris Angelico wrote: On Sat, Oct 25, 2014 at 4:23 AM, Tobiah wrote: Out of all of the replies, I don't think anyone actually offered the answer: a if condition else b Jean-Michel did, the very first response. ChrisA I had to search for it. For some reason

  1   2   3   4   >