Re: what do you get with 1 divide by 998001, interesting results

2014-08-21 Thread Terry Reedy
On 8/20/2014 11:36 AM, Everything You Need To Know wrote: Neat little exercise, surprisingly cool results! less than 3 minutes! https://www.youtube.com/watch?v=PlDjl5JK0eU&feature=youtu.be Dear EYNToK (Adam Nowak?, the name on the video?): I am both a long-term participant in this group and c

Re: what do you get with 1 divide by 998001, interesting results

2014-08-21 Thread Everything You Need To Know
On Thursday, 21 August 2014 16:55:44 UTC+9:30, Terry Reedy wrote: > On 8/20/2014 11:36 AM, Everything You Need To Know wrote: > > > Neat little exercise, surprisingly cool results! > > > less than 3 minutes! > > > > > > https://www.youtube.com/watch?v=PlDjl5JK0eU&feature=youtu.be > > > > De

proposed syntax for multiline anony-functions (hopefully?)

2014-08-21 Thread icefapper
Hi, just wanting to do a shot in the dark,but maybe this syntax is Pythonic (in a "we-are-all-grown-ups" fashion, ahem)enough to get its way into the language this is what yours truly thinks: don't we all know that ":" means the next token must be an indent (mostly)? and doesn't the "(" and its a

Re: what do you get with 1 divide by 998001, interesting results

2014-08-21 Thread Mark Lawrence
On 21/08/2014 03:07, Everything You Need To Know wrote: You'd make more friends here if you weren't suffering from google groups disease, which seems to be spreading like wildfire at the moment. To cure this terrible affliction please access this list via https://mail.python.org/mailman/listi

Re: what do you get with 1 divide by 998001, interesting results

2014-08-21 Thread Mark Lawrence
On 21/08/2014 07:09, Everything You Need To Know wrote: I am just finishing this thread, as I said it will take a little time, I am trying to collaborate with more than one person. You are certainly very trying. I see no evidence of collaboration. I also see no evidence of the vitriol you

Re: proposed syntax for multiline anony-functions (hopefully?)

2014-08-21 Thread Chris Angelico
Ah, here we go again! It's multi-line lambda season. Comes around as regularly as duck-typing season, rabbit seasoning, baseball season, and other Looney Tunes references. :) On Thu, Aug 21, 2014 at 5:55 PM, wrote: > doFunc(def(): >print( "anon" ) >return "gvr") What I'm seeing here is

Re: what do you get with 1 divide by 998001, interesting results

2014-08-21 Thread Mark Lawrence
On 21/08/2014 07:52, Everything You Need To Know wrote: I have answered all these questions already! stop wasting time I entirely agree, stop wasting time. Hardly surprising you didn't get on at uni as that involves engaging with people. You can't take the mildest criticism and refuse to

Re: what do you get with 1 divide by 998001, interesting results

2014-08-21 Thread Chris “Kwpolska” Warrick
On Thu, Aug 21, 2014 at 3:22 AM, Everything You Need To Know wrote: > I do understand where you are coming from 'Chris "Kwpolska" Warrick', though, > your own self serving link to your own website and unproductive post is > closer to spam than my own, I offer something practical and positive to

Re: what do you get with 1 divide by 998001, interesting results

2014-08-21 Thread Mark Lawrence
On 21/08/2014 08:40, Everything You Need To Know wrote: On Thursday, 21 August 2014 16:55:44 UTC+9:30, Terry Reedy wrote: On 8/20/2014 11:36 AM, Everything You Need To Know wrote: Neat little exercise, surprisingly cool results! less than 3 minutes! https://www.youtube.com/watch?v=P

Re: proposed syntax for multiline anony-functions (hopefully?)

2014-08-21 Thread icefapper
> reasonable, but I don't like the close parens on the same line; even > > if this syntax is allowed, I'd frown on it in style guides, > thanks, bu what exactly do you find unlikeable in this syntax? the ")" is no new syntax, but simply a match for a previous "("; and you can put it anywhere

Re: proposed syntax for multiline anony-functions (hopefully?)

2014-08-21 Thread Chris Angelico
On Thu, Aug 21, 2014 at 6:59 PM, wrote: > thanks, bu what exactly do you find unlikeable in this syntax? the ")" is no > new syntax, but simply a match for a previous "("; and you can put it > anywhere because the "(" contents are space-insensitive: > > this would be a syntax error: > a = def()

Re: proposed syntax for multiline anony-functions (hopefully?)

2014-08-21 Thread icefapper
reasonable, but I don't like the close parens on the same line; even > > if this syntax is allowed, I'd frown on it in style guides, > thanks, bu what exactly do you find unlikeable in this syntax? the ")" is no new syntax, but simply a match for a previous "("; and you can put it anywhere b

Re: proposed syntax for multiline anony-functions (hopefully?)

2014-08-21 Thread icefapper
it is simply a matter of convenience: def a(): print( "gvr" ) func(a); or func( def(): print("gvr") ) it would be great if others could further share their opinions -- https://mail.python.org/mailman/listinfo/python-list

Re: proposed syntax for multiline anony-functions (hopefully?)

2014-08-21 Thread Marko Rauhamaa
icefap...@gmail.com: > it is simply a matter of convenience: > > def a(): > print( "gvr" ) > func(a); > > or > > func( def(): >print("gvr") > ) > > it would be great if others could further share their opinions In practice, your proposal would not make life easier for Python programmers.

Re: proposed syntax for multiline anony-functions (hopefully?)

2014-08-21 Thread icefapper
> tag_handler = { > > "span": lambda content: content, > > "div": lambda content: "\n"+content+"\n", > > "p": lambda content: "\n"+content+"\n", > > "br": lambda content: "\n", > > } > > > > If you wanted to expand one of those to have statements in it, you'd > > have to t

Re: proposed syntax for multiline anony-functions (hopefully?)

2014-08-21 Thread icefapper
On Thursday, August 21, 2014 2:27:08 AM UTC-7, Marko Rauhamaa wrote: > In practice, your proposal would not make life easier for Python > > programmers. > > > > > > Marko neither did the lambda, yours truly supposes? -- https://mail.python.org/mailman/listinfo/python-list

ANN: PyDDF Sprint 2014

2014-08-21 Thread eGenix Team: M.-A. Lemburg
[This announcement is in German since it targets a local user group sprint in Düsseldorf, Germany] ANKÜNDIGUNG PyDDF Sprint 2014 27/28.09.2014 Python

Re: proposed syntax for multiline anony-functions (hopefully?)

2014-08-21 Thread Terry Reedy
On 8/21/2014 5:14 AM, icefap...@gmail.com wrote: it is simply a matter of convenience: def a(): print( "gvr" ) func(a); or func( def(): print("gvr") ) it would be great if others could further share their opinions I have, multiple time in previous threads. A bad idea. Unnecessary.

Python vs C++

2014-08-21 Thread David Palao
Hello, I consider myself a python programmer, although C++ was one of the first languages I learned (not really deeply and long time ago). Now I decided to retake C++, to broaden my view of the business. However, as I progress in learning C++, I cannot take out of my head one question Why to use

Re: what do you get with 1 divide by 998001, interesting results

2014-08-21 Thread Everything You Need To Know
On Thursday, 21 August 2014 01:06:37 UTC+9:30, Everything You Need To Know wrote: These exercises were all linked together to make a 'python' board game, Thought it was really neat myself. This is something that would not interest this Forum I am to presume? Thank you Adam A -- https://mail

Re: Python vs C++

2014-08-21 Thread Burak Arslan
On 08/21/14 15:54, David Palao wrote: > But I'm interested in a "genuine" > C++ project: some task where C++ is really THE language (and where > python is actually a bad ab initio choice) For my day job, I chose Qt on C++ for a classic desktop app that needs to be deployed on Windows (among other

Re: Python vs C++

2014-08-21 Thread Chris Angelico
On Thu, Aug 21, 2014 at 10:54 PM, David Palao wrote: > Why to use C++ instead of python? > > This is, perhaps, a bit off-topic, but I really want to know the > thoughts of experienced python programmers on it. No, it's a fair question. Why are we all here? The fact is, there's not a huge amount

Re: Python vs C++

2014-08-21 Thread Neil D. Cerutti
On 8/21/2014 8:54 AM, David Palao wrote: Hello, I consider myself a python programmer, although C++ was one of the first languages I learned (not really deeply and long time ago). Hey, that sounds just like me. Now I decided to retake C++, to broaden my view of the business. However, as I pro

Distinguishing attribute name from varible name to make codes clear and definite

2014-08-21 Thread luofeiyu
I feel that self.x and x will be confused in the following codes. class MyDescriptor(object): def __init__(self, x): self.x = x def __get__(self, instance, owner): print('get from descriptor') return self.x def __set__(self, in

Re: Python vs C++

2014-08-21 Thread Rustom Mody
On Thursday, August 21, 2014 6:24:18 PM UTC+5:30, David Palao wrote: > Hello, > I consider myself a python programmer, although C++ was one of the > first languages I learned (not really deeply and long time ago). > Now I decided to retake C++, to broaden my view of the business. > However, as I p

Re: Distinguishing attribute name from varible name to make codes clear and definite

2014-08-21 Thread Denis McMahon
On Thu, 21 Aug 2014 22:13:32 +0800, luofeiyu wrote: > I feel that self.x and x will be confused in the following codes. Then don't call them self.x and x, call them self.internal_x and param_x, or any other pair of different names. You are the one who chooses what names to use in your code. --

Re: Python vs C++

2014-08-21 Thread Grant Edwards
On 2014-08-21, David Palao wrote: > Why to use C++ instead of python? 1) C++ is the only language available for your platform, and for some reason you are unable to build Python from source. 2) You need money, and the only person willing to pay you says use C++ and won't listen to re

Re: Python vs C++

2014-08-21 Thread David Palao
Thank you for the interesting answers. Just a clarification. Actually for the scope of this question, I consider C and C++ quite different. At least when they are "properly" used (eg, you could use C++ as a better C, but this is not C++ in its full glory). In my opinion, if all that you want is pe

Re: Python vs C++

2014-08-21 Thread Michael Torrie
On 08/21/2014 07:39 AM, Burak Arslan wrote: > For my day job, I chose Qt on C++ for a classic desktop app that needs > to be deployed on Windows (among other platforms) with an installation > package that is as small as possible. > > All I need to do deployment-wise is to create an NSIS script put

Re: what do you get with 1 divide by 998001, interesting results

2014-08-21 Thread Steven D'Aprano
Ben Finney wrote: > Everything You Need To Know writes: > >> I guess I have to agree and was mistaken, though vitriol I found >> unnecessary and unproductive! > > You've behaved obnoxiously, as has been pointed out. People can point out anything they like, it does not mean it is necessarily s

Re: Python vs C++

2014-08-21 Thread Joseph Martinot-Lagarde
Le 21/08/2014 15:40, Chris Angelico a écrit : On Thu, Aug 21, 2014 at 10:54 PM, David Palao wrote: Why to use C++ instead of python? This is, perhaps, a bit off-topic, but I really want to know the thoughts of experienced python programmers on it. No, it's a fair question. Why are we all her

Re: 'is not' or '!='

2014-08-21 Thread Thomas Rachel
Am 20.08.2014 13:17 schrieb Chris Angelico: That's true, but how easy is it to annotate a file with each line's author (or, at least, to figure out who wrote some particular line of code)? It's easy enough with 'git blame' or 'hg blame', and it wouldn't surprise me if bzr had a similar feature;

Re: 'is not' or '!='

2014-08-21 Thread Dan Stromberg
On Mon, Aug 18, 2014 at 1:35 PM, ElChino wrote: > A newbie question to you; what is the difference between statements like: > if x is not None: > and > if x != None: > > Without any context, which one should be preferred? > IMHO, the latter is more readable. You've got some good answers. I'd li

Re: what do you get with 1 divide by 998001, interesting results

2014-08-21 Thread luofeiyu
This man is crazy , he go on to send rubbish to waste our time ,i strongly strongly advise that python maillist administrator kick him off here. On 8/21/2014 9:25 PM, Everything You Need To Know wrote: On Thursday, 21 August 2014 01:06:37 UTC+9:30, Everything You Need To Know wrote: These

Re: 'is not' or '!='

2014-08-21 Thread ElChino
"Dan Stromberg" wrote: You've got some good answers. I've counted around 210 messages in this thread!! I'd like to point out that this might make a good entry in a Python FAQ list... Ok. -- https://mail.python.org/mailman/listinfo/python-list

Re: what do you get with 1 divide by 998001, interesting results

2014-08-21 Thread Grant Edwards
On 2014-08-21, luofeiyu wrote: > This man is crazy, he go on to send rubbish to waste our time ,i > strongly strongly advise that python maillist administrator kick him > off here. He's not wasting my time -- I filter out all posts from Google Groups. What I do see is all of the responses. Pe

Re: what do you get with 1 divide by 998001, interesting results

2014-08-21 Thread Terry Reedy
On 8/21/2014 9:37 AM, luofeiyu wrote: This man is crazy Such ad hominem slurs are a violation to the Python Community Code of Conduct. he go on to send rubbish to waste our time , Everyone should stop bashing each other, including you. What I see is people driving each other a bit craz

Re: what do you get with 1 divide by 998001, interesting results

2014-08-21 Thread Terry Reedy
On 8/21/2014 12:50 PM, Steven D'Aprano wrote: Ben Finney wrote: Everything You Need To Know writes: I guess I have to agree and was mistaken, though vitriol I found unnecessary and unproductive! You've behaved obnoxiously, as has been pointed out. People can point out anything they like,

Re: Distinguishing attribute name from varible name to make codes clear and definite

2014-08-21 Thread Ben Finney
luofeiyu writes: > I feel that self.x and x will be confused in the following codes. I don't see how. The examples you give have the two quite distinct in every case. > exam=MyDescriptor("hallo") > > when class MyDescriptor initiate , the `hallo` was passed into x in > __init__(self, x);

Re: what do you get with 1 divide by 998001, interesting results

2014-08-21 Thread Ben Finney
Steven D'Aprano writes: > Adam ("Everything You Need To Know") has perhaps posted unwisely and > clumsily, but obnoxiously? > > Obnoxious (noun): > very offensive; hateful; odious; reprehensible. > > What did Adam do that was *obnoxious*? Here are some of the > accusations thrown at him:

Re: what do you get with 1 divide by 998001, interesting results

2014-08-21 Thread Mark Lawrence
On 21/08/2014 22:15, Ben Finney wrote: Steven D'Aprano writes: [War and Peace snipped] Frankly I think this entire debate has rapidly descended to the level of farce. Can we move on please? -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our la

Re: what do you get with 1 divide by 998001, interesting results

2014-08-21 Thread Rustom Mody
On Friday, August 22, 2014 1:45:23 AM UTC+5:30, Terry Reedy wrote: > On 8/21/2014 12:50 PM, Steven D'Aprano wrote: > > Ben Finney wrote: > >> Everything You Need To Know writes: > >>> I guess I have to agree and was mistaken, though vitriol I found > >>> unnecessary and unproductive! > >> You've be

Re: what do you get with 1 divide by 998001, interesting results

2014-08-21 Thread Rustom Mody
On Thursday, August 21, 2014 7:07:36 PM UTC+5:30, luofeiyu wrote: > This man is crazy , he go on to send rubbish to waste our time ,i > strongly strongly advise that python maillist administrator kick him off > here. > On 8/21/2014 9:25 PM, Everything You Need To Know wrote: > > On Thursday, 21

Re: what do you get with 1 divide by 998001, interesting results

2014-08-21 Thread Everything You Need To Know
On Friday, 22 August 2014 06:45:07 UTC+9:30, Ben Finney wrote: > When the initial engagement is a continuous repeating of the same > disrespectful behaviour, and it continues oblivious to requests to > correct the mistakes, I think the welcome has worn out. We are not > obligated to endure everyt

Re: Python vs C++

2014-08-21 Thread Chris Angelico
On Fri, Aug 22, 2014 at 4:05 AM, Joseph Martinot-Lagarde wrote: > For information, Cython works with C++ now: > http://docs.cython.org/src/userguide/wrapping_CPlusPlus.html. Now isn't that cool! Every time Cython gets discussed, I get a renewed desire to learn it. Trouble is, I don't have any pr

Re: what do you get with 1 divide by 998001, interesting results

2014-08-21 Thread Dan Stromberg
Amusing. It works in hexadecimal too: numerator = 1 denominator = 0xffe001 shift = int(16 ** 30) print(hex(int(numerator * shift / denominator))) -- https://mail.python.org/mailman/listinfo/python-list

Re: what do you get with 1 divide by 998001, interesting results

2014-08-21 Thread Joel Goldstick
On Thu, Aug 21, 2014 at 7:10 PM, Everything You Need To Know wrote: > On Friday, 22 August 2014 06:45:07 UTC+9:30, Ben Finney wrote: > >> When the initial engagement is a continuous repeating of the same >> disrespectful behaviour, and it continues oblivious to requests to >> correct the mistakes

the output in reference of descriptor.

2014-08-21 Thread luofeiyu
class C(object): a = 'abc' def __getattribute__(self, *args, **kwargs): print("__getattribute__() is called") return object.__getattribute__(self, *args, **kwargs) def __getattr__(self, name): print("__getattr__() is called ")

Re: what do you get with 1 divide by 998001, interesting results

2014-08-21 Thread Mark Lawrence
On 22/08/2014 00:28, Joel Goldstick wrote: I don't know the rules for announcements. https://mail.python.org/mailman/listinfo/python-announce-list also available through gmane.comp.python.announce -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for o

Very basic question. How do I start again?

2014-08-21 Thread Seymore4Head
I want to give the computer 100 tries to guess a random number between 1 and 100 picked by the computer. For the moment I am always using 37 as the random pick. I want to change the pick to pick=random.randrange(1,100). The program works as expected until the computer gets a correct guess. I do

Re: Very basic question. How do I start again?

2014-08-21 Thread Ben Finney
Seymore4Head writes: > The program works as expected until the computer gets a correct guess. > I don't know what I should be doing to restart the program when > pick=guess. There isn't a “restart the program” code we can give. But I think you need only something rather simpler: > while count <

Re: Very basic question. How do I start again?

2014-08-21 Thread Chris Angelico
On Fri, Aug 22, 2014 at 11:37 AM, Seymore4Head wrote: > I want to give the computer 100 tries to guess a random number between > 1 and 100 picked by the computer. > Suggestion: Be up-front about this being a homework assignment. Most of us can tell anyway, and it's more honest that way :) So, si

Re: Very basic question. How do I start again?

2014-08-21 Thread Seymore4Head
On Fri, 22 Aug 2014 11:55:58 +1000, Ben Finney wrote: >Seymore4Head writes: > >> The program works as expected until the computer gets a correct guess. >> I don't know what I should be doing to restart the program when >> pick=guess. > >There isn't a “restart the program” code we can give. But I

Re: Very basic question. How do I start again?

2014-08-21 Thread Chris Angelico
On Fri, Aug 22, 2014 at 12:13 PM, Seymore4Head wrote: > I tried puttingbreak_stmt ::= "break" at the point where I > want to start over:) ,but since there is no "start ove"r command, > I was happy to end the program. > > I get "invalid syntax so I triedbreak_stmt Ah, that's part

Re: Very basic question. How do I start again?

2014-08-21 Thread Seymore4Head
On Fri, 22 Aug 2014 11:58:00 +1000, Chris Angelico wrote: >On Fri, Aug 22, 2014 at 11:37 AM, Seymore4Head > wrote: >> I want to give the computer 100 tries to guess a random number between >> 1 and 100 picked by the computer. >> > >Suggestion: Be up-front about this being a homework assignment. M

Re: Very basic question. How do I start again?

2014-08-21 Thread Steven D'Aprano
Seymore4Head wrote: > I want to give the computer 100 tries to guess a random number between > 1 and 100 picked by the computer. > > For the moment I am always using 37 as the random pick. I want to > change the pick to pick=random.randrange(1,100). The program works as > expected until the com

Re: Very basic question. How do I start again?

2014-08-21 Thread Denis McMahon
On Thu, 21 Aug 2014 21:37:22 -0400, Seymore4Head wrote: > I want to give the computer 100 tries to guess a random number between 1 > and 100 picked by the computer. > > For the moment I am always using 37 as the random pick. I want to > change the pick to pick=random.randrange(1,100). The progr

Re: proposed syntax for multiline anony-functions (hopefully?)

2014-08-21 Thread alex23
On 21/08/2014 7:30 PM, icefap...@gmail.com wrote: On Thursday, August 21, 2014 2:27:08 AM UTC-7, Marko Rauhamaa wrote: In practice, your proposal would not make life easier for Python programmers. neither did the lambda, yours truly supposes? alex23 disagrees. alex23 finds the lambda extreme

Re: Very basic question. How do I start again?

2014-08-21 Thread Tim Roberts
Seymore4Head wrote: > >I want to give the computer 100 tries to guess a random number between >1 and 100 picked by the computer. If it takes more than 7, you're doing it wrong... -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- https://mail.python.org/mailman/listinfo/python-lis

Re: Python vs C++

2014-08-21 Thread dieter
David Palao writes: > Why to use C++ instead of python? Likely, you would not use Python to implement most parts of an operating system (where, for efficiency reasons, some parts are even implemented in an assembler language). I can imagine that the GNU compiler developers, too, had good reason

Re: Very basic question. How do I start again?

2014-08-21 Thread Igor Korot
Hi, On Thu, Aug 21, 2014 at 10:56 PM, Tim Roberts wrote: > Seymore4Head wrote: >> >>I want to give the computer 100 tries to guess a random number between >>1 and 100 picked by the computer. > > If it takes more than 7, you're doing it wrong... I think he meant: 100 runs of the script... Thank

Re: what is the difference between name and _name?

2014-08-21 Thread luofeiyu
I fix a mistake in Steven D'Aprano interpretation. class Person(object): def __init__(self, name): self._name = name def getName(self): print('fetch') return self._name def setName(self, value): print('change...') self._name = value

Re: Python vs C++

2014-08-21 Thread Chris Angelico
On Fri, Aug 22, 2014 at 4:12 PM, dieter wrote: > Likely, you would not use Python to implement most parts of an > operating system (where, for efficiency reasons, some parts > are even implemented in an assembler language). > > I can imagine that the GNU compiler developers, too, had good > reason

Re: Python vs C++

2014-08-21 Thread Stefan Behnel
dieter schrieb am 22.08.2014 um 08:12: > David Palao writes: >> Why to use C++ instead of python? > > Likely, you would not use Python to implement most parts of an > operating system (where, for efficiency reasons, some parts > are even implemented in an assembler language). > > I can imagine t