Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #39999

Re: Python Newbie

From "Piterrr" <piotrekd@optonline.net>
Newsgroups comp.lang.python
References <mailman.2567.1361905815.2939.python-list@python.org>
Subject Re: Python Newbie
Message-ID <we8Xs.273163$5F3.16674@fx21.fr7> (permalink)
Organization virginmedia.com
Date 2013-02-26 19:42 +0000

Show all headers | View raw


"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 

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

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

csiph-web