Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #39993 > unrolled thread
| Started by | Jean-Michel Pichavant <jeanmichel@sequans.com> |
|---|---|
| First post | 2013-02-26 20:09 +0100 |
| Last post | 2013-02-27 07:57 +1100 |
| Articles | 3 — 3 participants |
Back to article view | Back to comp.lang.python
Re: Python Newbie Jean-Michel Pichavant <jeanmichel@sequans.com> - 2013-02-26 20:09 +0100
Re: Python Newbie "Piterrr" <piotrekd@optonline.net> - 2013-02-26 19:42 +0000
Re: Python Newbie Chris Angelico <rosuav@gmail.com> - 2013-02-27 07:57 +1100
| From | Jean-Michel Pichavant <jeanmichel@sequans.com> |
|---|---|
| Date | 2013-02-26 20:09 +0100 |
| Subject | Re: Python Newbie |
| Message-ID | <mailman.2567.1361905815.2939.python-list@python.org> |
----- Original Message ----- > Hi guys, > > Question. Have this code > > intX = 32 # decl + init int var > intX_asString = None # decl + init with NULL string var > > intX_asString = intX.__str__ () # convert int to string > > What are these ugly underscores for? > _________________str___________________ > > Peter > -- > http://mail.python.org/mailman/listinfo/python-list I can't wait for the intX_asString_asBool = intX_asString.__bool__() if (intX_asString_asBool == True): # do something ;-) JM -- IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
[toc] | [next] | [standalone]
| From | "Piterrr" <piotrekd@optonline.net> |
|---|---|
| Date | 2013-02-26 19:42 +0000 |
| Message-ID | <we8Xs.273163$5F3.16674@fx21.fr7> |
| In reply to | #39993 |
"Jean-Michel Pichavant" <jeanmichel@sequans.com> wrote in message news:mailman.2567.1361905815.2939.python-list@python.org... > > ----- Original Message ----- >> Hi guys, >> >> Question. Have this code >> >> intX = 32 # decl + init int var >> intX_asString = None # decl + init with NULL string var >> >> intX_asString = intX.__str__ () # convert int to string >> >> What are these ugly underscores for? >> _________________str___________________ >> >> Peter >> -- >> http://mail.python.org/mailman/listinfo/python-list > > I can't wait for the > > intX_asString_asBool = intX_asString.__bool__() > > if (intX_asString_asBool == True): > # do something > > ;-) > > JM As serious a character as I am, I had good laughs at this. Don't you all like my questions for all the exitainment they offer? The "__str__" issue was a genuine question. I'm glad to find there is also a __bool_ () method, shall I need it. :-) Please note, this is not how I write my code. I'm not that bad a programmer, it's just Python which is so different that I am doing what I need to help clarify things and help me out. I don't find this post offensive, even though JM is deliberately making fun of me. But to his credit, it is funny indeed. Let's laugh 2gether! This reminds me, when I first started working with databases and saw an error msg which said that my query had "ambiguous columns" I laughed for 1/2 hr. I found it incredibly exitaining that a 100% deterministic piece of hardware could have the word "ambiguous" in its internal dictionary. :-)) Peter
[toc] | [prev] | [next] | [standalone]
| From | Chris Angelico <rosuav@gmail.com> |
|---|---|
| Date | 2013-02-27 07:57 +1100 |
| Message-ID | <mailman.2576.1361912238.2939.python-list@python.org> |
| In reply to | #39999 |
On Wed, Feb 27, 2013 at 6:42 AM, Piterrr <piotrekd@optonline.net> wrote: > This reminds me, when I first started working with databases and saw an > error msg which said that my query had "ambiguous columns" I laughed for 1/2 > hr. I found it incredibly exitaining that a 100% deterministic piece of > hardware could have the word "ambiguous" in its internal dictionary. Enjoy your laugh (laughter's good!), but there are a couple of wrong assumptions here. The hardware doesn't use the word "ambiguous", and the SQL engine (which is what does) isn't 100% deterministic. Or to be more technically correct, it's 100% deterministic with such a large set of inputs (many of which are outside your access, let alone control) that it may as well have a random component. Also, there's nothing strange about ambiguity: "Go and get the cornflour and the icing sugar. Put some of it into the cake mix." - what should you put in? Some of each? That's what the database has been asked to do, and it's not clear what should be done. Sorry to be the wet blanket on your joke (I think that metaphor's as mixed as cake batter), but facts is facts :) ChrisA
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.python
csiph-web