!wtf ellipsis

Discussion in 'Python' started by =?iso-8859-1?q?Jonas_K=F6lker?=, Aug 13, 2004.

  1. so, I've read the manuals, done a few hacks, read the quick reference.
    however, one thing still eludes me:

    what (the hell) is Ellipsis?
    what's it good for?
    how do I use it; how does the interpreter use it?

    .... thanks everybody,

    Jonas Kölker

    ----
    [ValueError: ASCII art sig block too ugly to live]
     
    =?iso-8859-1?q?Jonas_K=F6lker?=, Aug 13, 2004
    #1
    1. Advertising

  2. =?iso-8859-1?q?Jonas_K=F6lker?=

    Peter Otten Guest

    Jonas Kölker wrote:

    > what (the hell) is Ellipsis?
    > what's it good for?
    > how do I use it; how does the interpreter use it?


    Alex Martelli gave me the following explanation a while ago:

    http://groups.google.com/groups?selm=yQRrb.2233$

    Peter
     
    Peter Otten, Aug 13, 2004
    #2
    1. Advertising

  3. On Fri, 13 Aug 2004 14:54:24 +0200, rumours say that Jonas Kölker
    <> might have written:

    >what (the hell) is Ellipsis?
    >what's it good for?


    Peter provided a link answering your questions. As a side note, I have
    used Ellipsis instead of None as a very handy last item put in queues in
    threaded programs (after all, "ellipsis" means "absence" or "lack" in
    English :) Thus I avoid creating dummy classes to mark the end of
    data...
    --
    TZOTZIOY, I speak England very best,
    "Tssss!" --Brad Pitt as Achilles in unprecedented Ancient Greek
     
    Christos TZOTZIOY Georgiou, Aug 14, 2004
    #3
  4. Christos TZOTZIOY Georgiou wrote:

    > Peter provided a link answering your questions. As a side note, I
    > have
    > used Ellipsis instead of None as a very handy last item put in queues
    > in
    > threaded programs (after all, "ellipsis" means "absence" or "lack" in
    > English :) Thus I avoid creating dummy classes to mark the end of
    > data...


    But as a sentinel, why would it be superior to None?

    --
    __ Erik Max Francis && && http://www.alcyone.com/max/
    / \ San Jose, CA, USA && 37 20 N 121 53 W && AIM erikmaxfrancis
    \__/ If you don't take chances, you can't do anything in life.
    -- Michael Spinks
     
    Erik Max Francis, Aug 14, 2004
    #4
  5. On Fri, 13 Aug 2004 16:35:34 -0700, rumours say that Erik Max Francis
    <> might have written:

    >Christos TZOTZIOY Georgiou wrote:
    >
    >> Peter provided a link answering your questions. As a side note, I
    >> have
    >> used Ellipsis instead of None as a very handy last item put in queues
    >> in
    >> threaded programs (after all, "ellipsis" means "absence" or "lack" in
    >> English :) Thus I avoid creating dummy classes to mark the end of
    >> data...


    [Erik]
    >But as a sentinel, why would it be superior to None?


    I wouldn't choose the word "superior to", rather "more fitting than"
    IMO; that's because I associate None with "no value", and Ellipsis with
    "end of values".

    PS Irrelevant, but I just thought that it's probably too late to ask
    whether any Pythonistas are here in Athens for the Olympic games, in
    order to buy them a beer or another drink of their choice :)
    --
    TZOTZIOY, I speak England very best,
    "Tssss!" --Brad Pitt as Achilles in unprecedented Ancient Greek
     
    Christos TZOTZIOY Georgiou, Aug 14, 2004
    #5
  6. =?iso-8859-1?q?Jonas_K=F6lker?=

    AdSR Guest

    Christos "TZOTZIOY" Georgiou <> wrote in message news:<>...
    > On Fri, 13 Aug 2004 14:54:24 +0200, rumours say that Jonas Kölker
    > <> might have written:
    >
    > >what (the hell) is Ellipsis?
    > >what's it good for?

    >
    > Peter provided a link answering your questions. As a side note, I have
    > used Ellipsis instead of None as a very handy last item put in queues in
    > threaded programs (after all, "ellipsis" means "absence" or "lack" in
    > English :) Thus I avoid creating dummy classes to mark the end of
    > data...


    It's funny, I always understood ellipsis ('...') as a kind of a
    wildcard or abbreviation mark, rather than absence mark. For example,
    you'd write:

    a[1], a[2], ..., a[N]

    which means "all values from a[1] to a[N]" or something like that.

    But then of course it's just a symbol...

    AdSR
     
    AdSR, Aug 14, 2004
    #6
  7. AdSR wrote:

    > It's funny, I always understood ellipsis ('...') as a kind of a
    > wildcard or abbreviation mark, rather than absence mark. For example,
    > you'd write:
    >
    > a[1], a[2], ..., a[N]
    >
    > which means "all values from a[1] to a[N]" or something like that.
    >
    > But then of course it's just a symbol...


    It's an indication that something was removed or abbreviated. In
    mathematics, it has the same meaning, but it's often used in the context
    of showing a pattern and then removing unnecessary elements (after the
    pattern is obvious), so it tends to get the implied meaning of "and so
    on."

    --
    __ Erik Max Francis && && http://www.alcyone.com/max/
    / \ San Jose, CA, USA && 37 20 N 121 53 W && AIM erikmaxfrancis
    \__/ Suffering is a journey which has an end.
    -- Matthew Fox
     
    Erik Max Francis, Aug 15, 2004
    #7
    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. Nathan Sokalski
    Replies:
    2
    Views:
    541
    Hans Kesting
    Feb 14, 2006
  2. Chris Perkins

    Ellipsis outside a slice

    Chris Perkins, Oct 8, 2003, in forum: Python
    Replies:
    1
    Views:
    956
    Terry Reedy
    Oct 9, 2003
  3. Wayne Folta

    Ellipsis usage?

    Wayne Folta, Feb 18, 2004, in forum: Python
    Replies:
    2
    Views:
    4,937
    Peter Otten
    Feb 18, 2004
  4. Jerry Sievers

    slicing, mapping types, ellipsis etc.

    Jerry Sievers, Nov 29, 2004, in forum: Python
    Replies:
    9
    Views:
    375
    Kent Johnson
    Nov 30, 2004
  5. =?iso-8859-1?q?S=E9bastien_Boisg=E9rault?=

    doctest's ELLIPSIS

    =?iso-8859-1?q?S=E9bastien_Boisg=E9rault?=, Apr 29, 2005, in forum: Python
    Replies:
    5
    Views:
    883
    =?iso-8859-1?q?S=E9bastien_Boisg=E9rault?=
    May 2, 2005
Loading...

Share This Page