Re: [Tutor] What exactly does the three dots do? Why such as thing?

2017-08-27 Thread C W
Today, I ran into ellipsis again. This time, it is COMPLETELY different from before. Here is a reproducible code: import numpy as np import matplotlib.pyplot as plt ... x = np.linspace(0, 1) y = np.sin(4 * np.pi * x) * np.exp(-5 * x) plt.title('Week cycle') plt.xlabel('Month')

Re: [Tutor] What exactly does the three dots do? Why such as thing?

2017-08-11 Thread Steven D'Aprano
On Fri, Aug 11, 2017 at 07:57:09AM -0600, Mats Wichmann wrote: > On 08/10/2017 05:23 PM, Alan Gauld via Tutor wrote: > > On 10/08/17 14:39, C W wrote: > > > >> I suppose it's just a place holder, though I don't know when I would use it > >> in my every day life. > > > > Probably never. > > > >

Re: [Tutor] What exactly does the three dots do? Why such as thing?

2017-08-11 Thread Alan Gauld via Tutor
On 11/08/17 14:57, Mats Wichmann wrote: >> obscure features. Most Python programmers never use ellipses, > > I guess what this means is when I post code snippets with some lines > elided for greater readability of the point being made I should not use > ellipses for that, as they're actually a

Re: [Tutor] What exactly does the three dots do? Why such as thing?

2017-08-11 Thread Mats Wichmann
On 08/10/2017 05:23 PM, Alan Gauld via Tutor wrote: > On 10/08/17 14:39, C W wrote: > >> I suppose it's just a place holder, though I don't know when I would use it >> in my every day life. > > Probably never. > > Like most programming languages Python has a load of rarely used, > obscure

Re: [Tutor] What exactly does the three dots do? Why such as thing?

2017-08-10 Thread Alan Gauld via Tutor
On 10/08/17 14:39, C W wrote: > I suppose it's just a place holder, though I don't know when I would use it > in my every day life. Probably never. Like most programming languages Python has a load of rarely used, obscure features. Most Python programmers never use ellipses, metaclasses(*), the

Re: [Tutor] What exactly does the three dots do? Why such as thing?

2017-08-10 Thread C W
What's a literal? The only other time I heard about it was studying Shakespare. ;) I don't know what literal is. So, it won't help me to understand ellipsis, I really thought it was that oval shaped figure. Wiki says: "Literals are often used to initialize variables"

Re: [Tutor] What exactly does the three dots do? Why such as thing?

2017-08-10 Thread Steven D'Aprano
On Thu, Aug 10, 2017 at 09:39:02AM -0400, C W wrote: > What's a literal? The only other time I heard about it was studying > Shakespare. ;) A "literal" is syntax that creates a value, without the programmer needing to call a function. The syntax stands for the LITERAL value as shown. For

Re: [Tutor] What exactly does the three dots do? Why such as thing?

2017-08-10 Thread Steven D'Aprano
On Wed, Aug 09, 2017 at 12:06:37PM -0400, C W wrote: > Dear Python experts, > > What exactly does the three dots do? > > aList = ... ... is literal syntax for the Ellipsis singleton object. Ellipsis was added to the language at the express request of the numpy developers. Although numpy is a