Re: PEP 526 - var annotations and the spirit of python

2018-07-03 Thread Ben Finney via Python-list
Jim Lee writes: > If you were to say John had 2 apples, Jane had 4 apples, and Joe had > an indefinite number of apples, how many numbers are we talking about? Three numbers. And “indefinite” is not one of those numbers. So, no, that doesn't support “"indefinite" is a number”. -- \

Re: Valid encodings for a Python source file

2018-06-07 Thread Ben Finney via Python-list
Daniel Glus writes: > I'm trying to figure out the entire list of possible encodings for a Python > source file - that is, encodings that can go in a PEP 263 > encoding specification, like # > -*- encoding: foo -*-. What if the answer is not an

Re: $srcdir and $datadir

2018-02-10 Thread Ben Finney via Python-list
Victor Porton writes: > I want my program to work both when it is installed (using $datadir) > and when it is not yet installed (using $srcdir). Given your descriptions of both those, I don't see how it can reliably work; the program will expect directories that may not exist.

Re: Why does __ne__ exist?

2018-01-07 Thread Ben Finney via Python-list
Chris Angelico writes: > On Mon, Jan 8, 2018 at 10:55 AM, Ben Finney > wrote: > > We've established that it is useful to allow data types to define > > their own meaning of “equal” and “not equal”, like many other > > operations. Is that not good

Re: Native object exposing buffer protocol

2018-01-05 Thread Ben Finney via Python-list
Rob Gaddi writes: > I'd like to create a native Python object that exposes the buffer > protocol. Basically, something with a ._data member which is a > bytearray that I can still readinto, make directly into a numpy array, > etc. The “etc.” seems pretty

Re: why del is not a function or method?

2017-10-16 Thread Ben Finney via Python-list
Steve D'Aprano writes: > On Tue, 17 Oct 2017 03:16 am, Oren Ben-Kiki wrote: > > > That doesn't explain why `del` isn't a method though. > > `del` cannot be a method or a function, because the argument to `del` > is the name of the variable, not the contents of the