Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: Python Newbie

Reply
Thread Tools

Re: Python Newbie

 
 
Jean-Michel Pichavant
Guest
Posts: n/a
 
      02-26-2013

----- 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.
 
Reply With Quote
 
 
 
 
Piterrr
Guest
Posts: n/a
 
      02-26-2013
"Jean-Michel Pichavant" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>
> ----- 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

 
Reply With Quote
 
 
 
 
Chris Angelico
Guest
Posts: n/a
 
      02-26-2013
On Wed, Feb 27, 2013 at 6:42 AM, Piterrr <(E-Mail Removed)> 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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
(Python newbie) Using XP-SP2/MSVC6: No Python24_d.lib, winzip barfs on Python-2.4.1.tar, cannot download bzip2 Bill Davy Python 12 04-22-2005 12:19 PM
Re: (Python newbie) Using XP-SP2/MSVC6: No Python24_d.lib,winzip barfs on Python-2.4.1.tar, cannot download bzip2 Jaime Wyant Python 0 04-21-2005 12:49 PM
RE: (Python newbie) Using XP-SP2/MSVC6: No Python24_d.lib,winzip barfs on Python-2.4.1.tar, cannot download bzip2 Bill Davy Python 0 04-19-2005 09:27 AM
Python Newbie. Python on PPC, please assist. pythonnewbie Python 5 10-12-2004 05:51 PM
Creating an OLE server document in Python (MFC/OLE/COM/Python newbie) Drew Pihera Python 0 02-04-2004 07:48 PM



Advertisments