"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
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.
>
>
> 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
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
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
>
> > 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
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
"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
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
ok, thank you!
Abdur-Rahmaan Janhangeer
https://github.com/Abdur-rahmaanJ
Mauritius
--
https://mail.python.org/mailman/listinfo/python-list
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
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
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
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
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
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
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?
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
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
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
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
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
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
> 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
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
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 -
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
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
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
Organizational Behavior and Management, 11th Edition by Robert Konopaske and
John Ivancevich and Michael Matteson
--
https://mail.python.org/mailman/listinfo/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, "
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
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 /
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
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
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
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:
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
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
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
> 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
> 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)
> >
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
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
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
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
> 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
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
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
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
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
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
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
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
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
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:
...
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
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 =
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
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
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
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
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 {
>
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
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
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
"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
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
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
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
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
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
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
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
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
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
--
https://mail.python.org/mailman/listinfo/python-list
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
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
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
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)
>
>
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
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
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
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']
>>
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
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
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
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
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
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
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
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
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?
>
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
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
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
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,
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
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 - 100 of 392 matches
Mail list logo