RE: Python's simplicity philosophy

Discussion in 'Python' started by Tim Peters, Nov 15, 2003.

  1. Tim Peters

    Tim Peters Guest

    [Andrew Dalke]
    > There's also a __reduce__ and __reduce_ex__ in the pickle
    > protocol. See http://www.python.org/peps/pep-0307.html .
    > It's by far the most mentioned 'reduce' in the Python standard
    > library. Does it have anything to do with the 'reduce' function?
    > Not that I can tell.


    It doesn't -- reduce() and __reduce__() have no intersection.

    > But I can't find an explaination for that choice of a name.


    Well, this comes from the tradition that thought it made good sense to call
    a serialized object representation "a pickle". Applying the same kind of
    real-life common sense, what do you call the act of changing a real-world
    object, like a refrigerator or a wide-screen plasma TV, into a string, a
    (function, args) tuple, or a (function, args, state) tuple sufficient to
    reproduce the fridge or TV? Of course everyone calls that "reducing the
    refrigerator" or "reduce_exing the wide-screen plasma TV". Hence the kind
    of people who thought "pickle" was a good name also thought it was a good
    idea to stick underscores around "reduce" and "reduce_ex" <wink>.

    Possibly more likely is that they knew they wouldn't remember how to spell
    __cerealeyes__. Give a pro a reduce and he can re-pro-duce.
     
    Tim Peters, Nov 15, 2003
    #1
    1. Advertising

  2. Tim Peters

    Andrew Dalke Guest

    Uncle Tim:
    > what do you call the act of changing a real-world
    > object, like a refrigerator or a wide-screen plasma TV, into a string, a
    > (function, args) tuple, or a (function, args, state) tuple sufficient to
    > reproduce the fridge or TV?


    I call it "documenting what I own for insurance purposes."
    I need the receipt and/or, for good measure, a picture of the
    TV in my home. The exercise of turning those into a string
    in such a way that my insurance company will accept it as
    proof is left to the student as an exercise.

    Well, you did ask. :)

    Interestingly, to pickle something you can add vinegar, which
    is a mild acid. Sadly, the chemistry I know is very skewed
    having come to chemistry via biophysics. I can't tell if adding
    vinegar makes the brine slightly reducing or slightly oxidizing.
    It would be quite amusing if the former.

    Will a Real Chemist [tm] please chime in?

    Andrew
     
    Andrew Dalke, Nov 15, 2003
    #2
    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. Frank D. Greco
    Replies:
    0
    Views:
    347
    Frank D. Greco
    Feb 15, 2005
  2. JKop

    Simplicity

    JKop, Sep 4, 2004, in forum: C++
    Replies:
    34
    Views:
    1,253
  3. jacob navia

    Simplicity has a future

    jacob navia, May 30, 2006, in forum: C Programming
    Replies:
    109
    Views:
    1,513
    Richard Tobin
    Jun 6, 2006
  4. frittino
    Replies:
    0
    Views:
    287
    frittino
    May 16, 2009
  5. Mike Austin

    Efficiency vs. simplicity

    Mike Austin, Mar 16, 2006, in forum: Ruby
    Replies:
    0
    Views:
    97
    Mike Austin
    Mar 16, 2006
Loading...

Share This Page