Re: Python Newbie

Discussion in 'Python' started by Jean-Michel Pichavant, Feb 26, 2013.

  1. ----- 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.
    Jean-Michel Pichavant, Feb 26, 2013
    #1
    1. Advertising

  2. Jean-Michel Pichavant

    Piterrr Guest

    "Jean-Michel Pichavant" <> wrote in message
    news:...
    >
    > ----- 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
    Piterrr, Feb 26, 2013
    #2
    1. Advertising

  3. On Wed, Feb 27, 2013 at 6:42 AM, Piterrr <> 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
    Chris Angelico, Feb 26, 2013
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kruno Saho
    Replies:
    0
    Views:
    131
    Kruno Saho
    Apr 7, 2013
  2. Dave Angel
    Replies:
    0
    Views:
    113
    Dave Angel
    Apr 7, 2013
  3. rusi
    Replies:
    0
    Views:
    102
  4. Miki Tebeka
    Replies:
    0
    Views:
    76
    Miki Tebeka
    Apr 7, 2013
  5. Dennis Lee Bieber

    Re: Newbie to python. Very newbie question

    Dennis Lee Bieber, Apr 7, 2013, in forum: Python
    Replies:
    1
    Views:
    87
    Miki Tebeka
    Apr 8, 2013
Loading...

Share This Page