Re: Keyboard standards

2014-03-29 Thread Larry Hudson
On 03/29/2014 12:41 PM, Michael Torrie wrote: On 03/29/2014 01:27 PM, Larry Hudson wrote: On 03/28/2014 09:26 PM, Mark H Harris wrote: PS Thunderbird puts *both* the list and the news group addys in the to: header field on reply-to-list. ~nice, huh. Must be the way YOU set it up. MY Th

Re: checking if two things do not equal None

2014-03-29 Thread Ben Finney
Chris Angelico writes: > The problem isn't that I can't see what the comparisons are. It makes > very good sense to bound a variable within constants; but you already > know exactly where 2 is on the number line, so asking "Is 2 between > these two variables" seems a bit odd. Maybe it's less so w

Re: OFF TOPIC Spanish in the USA [was Re: Explanation of this Python language feature?]

2014-03-29 Thread Mark H Harris
On 3/30/14 1:31 AM, Steven D'Aprano wrote: I'm not sure what point you are trying to make. We have people here from all over the earth, and enough illegal immigrants speaking Spanish to account for a population about the size of Ohio. *raises eyebrow* Did you intend to imply that it is only il

Re: checking if two things do not equal None

2014-03-29 Thread Gregory Ewing
Roy Smith wrote: But, if you show me a != None != b: my brain just goes into overload. Chained comparisons get weird with not-equal operators. If you see a == b == c then it implies that a == c, but a != b != c does *not* imply that a != c. At least it doesn't in Python; I've never s

Re: OFF TOPIC Spanish in the USA [was Re: Explanation of this Python language feature?]

2014-03-29 Thread Chris Angelico
On Sun, Mar 30, 2014 at 5:31 PM, Steven D'Aprano wrote: > Did you intend to imply that it is only illegal immigrants who speak > Spanish in the USA? I think he's correct there. After all, anyone who doesn't fit the white-skinned monolingual (barely-one-language, really) middle-class stereotype *M

OFF TOPIC Spanish in the USA [was Re: Explanation of this Python language feature?]

2014-03-29 Thread Steven D'Aprano
On Sun, 30 Mar 2014 00:52:20 -0500, Mark H Harris wrote: > On 3/29/14 10:45 AM, Mark Lawrence wrote: >> On 29/03/2014 08:21, Mark H Harris wrote: >>> >>> Yes. Well, as the joke goes, if you're trilingual you speak three >>> languages, if you're bilingual you speak two languages, if you're >>>

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-03-29 Thread Mark H Harris
On 3/29/14 12:53 PM, Steven D'Aprano wrote: People have had localised code pages, and localised keyboards to enter characters in those code pages, for up to 30 years, if not longer. Nobody is arguing otherwise, Steven. Having a code page for a local language is not the same thing as having

Re: unicode as valid naming symbols

2014-03-29 Thread Gregory Ewing
Chris Angelico wrote: a 5x8 bitmap has forty pixels, any of which can be either on or off - that gives roughly twice as much data space as the 21-bit Unicode spec. We don't need a font, then -- just map the pixels straight onto bits in the character code! Might require some user re-education,

Re: checking if two things do not equal None

2014-03-29 Thread Chris Angelico
On Sun, Mar 30, 2014 at 4:54 PM, Steven D'Aprano wrote: > On Sun, 30 Mar 2014 13:15:18 +1100, Chris Angelico wrote: > >> Chained comparisons where you're checking a single variable against two >> constants make perfect sense: >> >> 2 < x < 5 >> >> Chained comparisons where you check a single const

Re: checking if two things do not equal None

2014-03-29 Thread Steven D'Aprano
On Sat, 29 Mar 2014 19:54:09 -0700, Rustom Mody wrote: > On Sunday, March 30, 2014 8:09:45 AM UTC+5:30, Roy Smith wrote: >> I have no particular problem with > >> x < 2 < y > >> because it fits the same pattern. But, if you show me > >> a != None != b: > >> my brain just goes into overload.

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-03-29 Thread Mark H Harris
On 3/29/14 6:59 AM, Marko Rauhamaa wrote: I hate localization. You get a error message in Finnish from "make" or "grep" and then you try to google it. So mine is en_US, but I know people who do fi_FI. ... this is my point precisely. -- https://mail.python.org/mailman/listinfo/python-list

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-03-29 Thread Mark H Harris
On 3/29/14 10:45 AM, Mark Lawrence wrote: On 29/03/2014 08:21, Mark H Harris wrote: Yes. Well, as the joke goes, if you're trilingual you speak three languages, if you're bilingual you speak two languages, if you're monolingual you're an American (well, that might go for Australia too, mayb

Re: checking if two things do not equal None

2014-03-29 Thread Steven D'Aprano
On Sun, 30 Mar 2014 13:15:18 +1100, Chris Angelico wrote: > On Sun, Mar 30, 2014 at 1:04 PM, Steven D'Aprano > wrote: >> On Sat, 29 Mar 2014 17:07:20 -0400, Roy Smith wrote: >> >>> I certainly agree that things like >>> if a is not b is not None: ... >>> >>> belong in an obfuscated coding co

Re: checking if two things do not equal None

2014-03-29 Thread Zachary Ware
On March 29, 2014 9:43:00 PM CDT, Roy Smith wrote: >In article <5337807b$0$29994$c3e8da3$54964...@news.astraweb.com>, > Steven D'Aprano wrote: > >> a is b is c is None > >And we are all together. See how they run like pigs from a gun, see >how >they fly. I'm cryin'. (Really, that was terrib

Re: checking if two things do not equal None

2014-03-29 Thread Rustom Mody
On Sunday, March 30, 2014 8:09:45 AM UTC+5:30, Roy Smith wrote: > I have no particular problem with > x < 2 < y > because it fits the same pattern. But, if you show me > a != None != b: > my brain just goes into overload. Honestly, I don't even know what that > means. My brain keeps tryin

Re: Dynamically reference member of array

2014-03-29 Thread R. Michael Weylandt
On Wed, Mar 26, 2014 at 7:43 AM, Ben Collier wrote: > Hi all, > > I know that I can dynamically reference a variable with locals()["i"], for > instance, but I'd like to know how to do this with a variable in an object. > > If I have an object called "device", with variables called attr1, attr2 ..

Re: checking if two things do not equal None

2014-03-29 Thread Roy Smith
In article <5337807b$0$29994$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: > a is b is c is None And we are all together. See how they run like pigs from a gun, see how they fly. -- https://mail.python.org/mailman/listinfo/python-list

Re: checking if two things do not equal None

2014-03-29 Thread Roy Smith
In article , Chris Angelico wrote: > Chained comparisons where you're checking a single variable against > two constants make perfect sense: > > 2 < x < 5 > > Chained comparisons where you check a single constant against two > variables don't, so much: > > x < 2 < y To me, chained comparison

Re: checking if two things do not equal None

2014-03-29 Thread Steven D'Aprano
On Sat, 29 Mar 2014 17:36:55 -0500, Tim Chase wrote: > And for cases where you have more than one or two things to test for > None-itude, you could use > > if all(x is None for x in [a, b, c, d]): > do_something_if_theyre_all_None() > > or > > if all(x is not None for x in [a, b, c, d])

Re: checking if two things do not equal None

2014-03-29 Thread Chris Angelico
On Sun, Mar 30, 2014 at 1:04 PM, Steven D'Aprano wrote: > On Sat, 29 Mar 2014 17:07:20 -0400, Roy Smith wrote: > >> I certainly agree that things like >> >>> if a is not b is not None: ... >> >> belong in an obfuscated coding contest. > > Apart from the fact that I got it wrong (that's what happen

Re: checking if two things do not equal None

2014-03-29 Thread Steven D'Aprano
On Sat, 29 Mar 2014 17:07:20 -0400, Roy Smith wrote: > I certainly agree that things like > >> if a is not b is not None: ... > > belong in an obfuscated coding contest. Apart from the fact that I got it wrong (that's what happens when I post at 6am after being up all night, thanks for the co

Re: checking if two things do not equal None

2014-03-29 Thread Chris Angelico
On Sun, Mar 30, 2014 at 12:19 PM, Tim Chase wrote: > On 2014-03-30 10:17, Chris Angelico wrote: >> On Sun, Mar 30, 2014 at 9:46 AM, Tim Chase >> wrote: >>> Though am I correct that your iteration tests for equality, while >>> mine tests for identity? Also, my version bails early in the >>> event

Re: checking if two things do not equal None

2014-03-29 Thread Tim Chase
On 2014-03-30 10:17, Chris Angelico wrote: > On Sun, Mar 30, 2014 at 9:46 AM, Tim Chase > wrote: >> Though am I correct that your iteration tests for equality, while >> mine tests for identity? Also, my version bails early in the >> event quitting early is possible. That's particularly useful in

Re: checking if two things do not equal None

2014-03-29 Thread Ethan Furman
On 03/29/2014 02:01 PM, Johannes Bauer wrote: On 29.03.2014 20:05, Steven D'Aprano wrote: On Sat, 29 Mar 2014 11:56:50 -0700, contact.trigon wrote: if (a, b) != (None, None): or if a != None != b: Preference? Pros? Cons? Alternatives? if not (a is b is None): ... Or if you prefer: if a is

Re: checking if two things do not equal None

2014-03-29 Thread contact . trigon
Thanks everyone; it has been very educational. > Dave Angel: > ...we'll find that two of the alternatives are not even equivalent. That helped me realize (a,b) != (None, None) is not correct for the function. It's a case where two parameters have None as the default argument. What I want is to

Re: checking if two things do not equal None

2014-03-29 Thread Chris Angelico
On Sun, Mar 30, 2014 at 9:46 AM, Tim Chase wrote: > Though am I correct that your iteration tests for equality, while > mine tests for identity? Also, my version bails early in the event > quitting early is possible. That's particularly useful in the case > of doing something like > > if all(x

Re: checking if two things do not equal None

2014-03-29 Thread Terry Reedy
On 3/29/2014 2:56 PM, contact.tri...@gmail.com wrote: if (a, b) != (None, None): or if a != None != b: Preference? Pros? Cons? Alternatives? if a is not None is not b == if a is not None and None is not b == if a is not None and b is not None which is what I would write if not trying to be cut

Re: checking if two things do not equal None

2014-03-29 Thread Roy Smith
In article , Tim Chase wrote: > On 2014-03-29 18:41, Roy Smith wrote: > > On Mar 29, 2014, at 6:36 PM, Tim Chase wrote: > > > > > And for cases where you have more than one or two things to test > > > for None-itude, you could use > > > > > > if all(x is None for x in [a, b, c, d]): > > >

Re: checking if two things do not equal None

2014-03-29 Thread Tim Chase
On 2014-03-29 18:41, Roy Smith wrote: > On Mar 29, 2014, at 6:36 PM, Tim Chase wrote: > > > And for cases where you have more than one or two things to test > > for None-itude, you could use > > > > if all(x is None for x in [a, b, c, d]): > >do_something_if_theyre_all_None() > > I might ha

Re: checking if two things do not equal None

2014-03-29 Thread Roy Smith
On Mar 29, 2014, at 6:36 PM, Tim Chase wrote: > And for cases where you have more than one or two things to test for > None-itude, you could use > > if all(x is None for x in [a, b, c, d]): >do_something_if_theyre_all_None() I might have written that as: if set([a, b, c, d]) == set(None)

Re: checking if two things do not equal None

2014-03-29 Thread Tim Chase
On 2014-03-29 17:07, Roy Smith wrote: > > if (a is not None) or (b is not None): > > > > is immediately understandable by everyone? > > I agree with that. But > > > if (a, b) != (None, None): > > seems pretty straight-forward to me too. In fact, if anything, it > seems easier to understan

Re: checking if two things do not equal None

2014-03-29 Thread Johannes Bauer
On 29.03.2014 22:55, Johannes Bauer wrote: >>> if (a is not None) or (b is not None): > > Yes, probably. I liked the original, too. If I were writing the code, > I'd probably try to aim to invert the condition though and simply do > > if (a is None) and (b is None) > > Which is pretty easy to u

Re: unicode as valid naming symbols

2014-03-29 Thread Chris Angelico
On Sun, Mar 30, 2014 at 5:11 AM, Dennis Lee Bieber wrote: > Considering that a 5x8 bitmap font (which is unlikely to even have > enough pixels to produce even 65536 unique glyphs) would take 5.6MB for > your (17*65536), I wouldn't want to see what an algorithmic description > would require

Re: checking if two things do not equal None

2014-03-29 Thread Johannes Bauer
On 29.03.2014 22:07, Roy Smith wrote: > I agree with that. But > >> if (a, b) != (None, None): > > seems pretty straight-forward to me too. In fact, if anything, it seems > easier to understand than > >> if (a is not None) or (b is not None): Yes, probably. I liked the original, too. If I w

Re: checking if two things do not equal None

2014-03-29 Thread Dave Angel
Roy Smith Wrote in message: > In article , > Johannes Bauer wrote: > >> On 29.03.2014 20:05, Steven D'Aprano wrote: >> > On Sat, 29 Mar 2014 11:56:50 -0700, contact.trigon wrote: >> > >> >> if (a, b) != (None, None): >> >> or >> >> if a != None != b: >> >> >> >> Preference? Pros? Cons? Altern

Re: Keyboard standards

2014-03-29 Thread Dave Angel
Larry Hudson Wrote in message: > On 03/28/2014 09:26 PM, Mark H Harris wrote: >> >> PS Thunderbird puts *both* the list and the news group addys in the to: >> header field on >> reply-to-list. ~nice, huh. > > Must be the way YOU set it up. MY Thunderbird (currently version 24.4.0 on > Min

Re: checking if two things do not equal None

2014-03-29 Thread Roy Smith
In article , Johannes Bauer wrote: > On 29.03.2014 20:05, Steven D'Aprano wrote: > > On Sat, 29 Mar 2014 11:56:50 -0700, contact.trigon wrote: > > > >> if (a, b) != (None, None): > >> or > >> if a != None != b: > >> > >> Preference? Pros? Cons? Alternatives? > > > > if not (a is b is None): ...

Re: checking if two things do not equal None

2014-03-29 Thread Johannes Bauer
On 29.03.2014 20:05, Steven D'Aprano wrote: > On Sat, 29 Mar 2014 11:56:50 -0700, contact.trigon wrote: > >> if (a, b) != (None, None): >> or >> if a != None != b: >> >> Preference? Pros? Cons? Alternatives? > > if not (a is b is None): ... > > Or if you prefer: > > if a is not b is not None: ..

Re: Keyboard standards

2014-03-29 Thread Michael Torrie
On 03/29/2014 01:27 PM, Larry Hudson wrote: > On 03/28/2014 09:26 PM, Mark H Harris wrote: >> >> PS Thunderbird puts *both* the list and the news group addys in the to: >> header field on >> reply-to-list. ~nice, huh. > > Must be the way YOU set it up. MY Thunderbird (currently version 24.4.

Re: Keyboard standards

2014-03-29 Thread Larry Hudson
On 03/28/2014 09:26 PM, Mark H Harris wrote: PS Thunderbird puts *both* the list and the news group addys in the to: header field on reply-to-list. ~nice, huh. Must be the way YOU set it up. MY Thunderbird (currently version 24.4.0 on Mint Linux 16) doesn't do any such thing. Besides,

Re: checking if two things do not equal None

2014-03-29 Thread contact . trigon
> Do you actually want to check for arbitrary objects which may claim to > equal None, or do you want to check for objects which are None? Arbitrary objects are not a concern. > if not (a is b is None): ... > > if a is not b is not None: ... Thanks for the examples. -- https://mail.python.o

Re: checking if two things do not equal None

2014-03-29 Thread Lele Gaifax
Steven D'Aprano writes: > if not (a is b is None): ... > > Or if you prefer: > > if a is not b is not None: ... >>> 1 is not 1 is not None False So definitely the former! ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad ave

Re: checking if two things do not equal None

2014-03-29 Thread Steven D'Aprano
On Sat, 29 Mar 2014 11:56:50 -0700, contact.trigon wrote: > if (a, b) != (None, None): > or > if a != None != b: > > Preference? Pros? Cons? Alternatives? Do you actually want to check for arbitrary objects which may claim to equal None, or do you want to check for objects which are None? Nea

checking if two things do not equal None

2014-03-29 Thread contact . trigon
if (a, b) != (None, None): or if a != None != b: Preference? Pros? Cons? Alternatives? :D -- https://mail.python.org/mailman/listinfo/python-list

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-03-29 Thread Steven D'Aprano
On Fri, 28 Mar 2014 23:40:01 -0500, Mark H Harris wrote: > On 3/28/14 10:51 PM, Steven D'Aprano wrote: >> You are being patronising to the 94% of the world that is not from the >> USA. Do you honestly think that people all over the world have been >> using computers for 30 or 40 years without any

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-03-29 Thread Gene Heskett
On Saturday 29 March 2014 13:12:06 Roy Smith did opine: > In article <87txahi68z@elektro.pacujo.net>, > > Marko Rauhamaa wrote: > > (But no, I wouldn't name my variables in Hebrew because the next > > maintainer might not have a keyboard like mine.) > > Have you ever done any work in PHP?

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-03-29 Thread Gene Heskett
On Saturday 29 March 2014 13:47:13 Marko Rauhamaa did opine: > Roy Smith : > > Have you ever done any work in PHP? Many of the error messages are > > Hebrew, transliterated into English. I've gotten many a > > T_PAAMAYIM_NEKUDOTAYIM error. > > I hate localization. You get a error message in Finni

Re: Keyboard standards

2014-03-29 Thread Steven D'Aprano
On Sat, 29 Mar 2014 00:40:43 -0500, Mark H Harris wrote: > On 3/29/14 12:13 AM, Chris Angelico wrote: >> >> When I first met Windows keys, I just popped 'em off and left a gap. >> Worked fine. > > ha! see.. it popped you off too! :-)) I found it arrogant to the > max to place their stupid lo

Re: Howto flaten a list of lists was (Explanation of this Python language feature)

2014-03-29 Thread mm0fmf
On 28/03/2014 22:12, Mark Lawrence wrote: As for the stupid symbol that you're using, real programmers don't give a damn about such things, they prefer writing plain, simple, boring code that is easy to read What he said. -- https://mail.python.org/mailman/listinfo/python-list

Re: Howto flaten a list of lists was (Explanation of this Python language feature)

2014-03-29 Thread Mark Lawrence
On 29/03/2014 03:21, Rustom Mody wrote: On Saturday, March 29, 2014 8:34:19 AM UTC+5:30, Mark H. Harris wrote: On 3/28/14 9:33 PM, Steven D'Aprano wrote: Mark, please stop posting to the newsgroup comp.lang.python AND the mailing list (...). They mirror each other. Your posts are not so importa

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-03-29 Thread Mark Lawrence
On 29/03/2014 08:21, Mark H Harris wrote: Yes. Well, as the joke goes, if you're trilingual you speak three languages, if you're bilingual you speak two languages, if you're monolingual you're an American (well, that might go for Australia too, maybe). When whole continents speak the same la

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-03-29 Thread Marko Rauhamaa
Roy Smith : > Have you ever done any work in PHP? Many of the error messages are > Hebrew, transliterated into English. I've gotten many a > T_PAAMAYIM_NEKUDOTAYIM error. I hate localization. You get a error message in Finnish from "make" or "grep" and then you try to google it. So mine is en_US

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-03-29 Thread Roy Smith
In article <87txahi68z@elektro.pacujo.net>, Marko Rauhamaa wrote: > (But no, I wouldn't name my variables in Hebrew because the next > maintainer might not have a keyboard like mine.) Have you ever done any work in PHP? Many of the error messages are Hebrew, transliterated into English.

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-03-29 Thread Marko Rauhamaa
Steven D'Aprano : > Under what circumstances do you see yourself needing a keyboard capable > of typing Hindi? > > I don't wish to pay for a keyboard for entering Arabic Everybody should be able to have a keyboard for their needs. If I should need an APL keyboard, I would have it in a jiffy. At

Re: Keyboard standards

2014-03-29 Thread Ian Kelly
On Fri, Mar 28, 2014 at 11:40 PM, Mark H Harris wrote: > On 3/29/14 12:13 AM, Chris Angelico wrote: >> >> When I first met Windows keys, I just popped 'em off and left a gap. >> Worked fine. > > ha! see.. it popped you off too! :-)) I found it arrogant to the max to > place their stupid logo

Re: Explanation of this Python language feature? [x for x in x for x in x] (to flatten a nested list)

2014-03-29 Thread Mark H Harris
On 3/29/14 1:03 AM, Chris Angelico wrote: http://forum.ecomstation.ru/ Prominent discussion forum, although that strives to be at least partially bilingual in deference to those of us who are so backward as to speak only English. Yes. Well, as the joke goes, if you're trilingual you speak

Embroidermodder2 Kickstarter for Python also!

2014-03-29 Thread Metallicow
Dear Pythoneers, Just letting you know we got a Kickstarter going on for Embroidermodder2 finally. We are going to need all the support we can get. https://www.kickstarter.com/projects/redteam316/embroidermodder-2-for-windows-mac-linux-pi-and-ard What is the program for you may ask...? It is for