!wtf ellipsis

  • Thread starter =?iso-8859-1?q?Jonas_K=F6lker?=
  • Start date
?

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

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
 
C

Christos TZOTZIOY Georgiou

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...
 
E

Erik Max Francis

Christos said:
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?
 
C

Christos TZOTZIOY Georgiou

Christos said:
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 :)
 
A

AdSR

Christos "TZOTZIOY" Georgiou said:
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
 
E

Erik Max Francis

AdSR said:
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."
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top