[Python-Dev] Re: PEP 618: Add Optional Length-Checking To zip

2020-06-01 Thread Nick Coghlan
On Thu., 21 May 2020, 4:09 am Jim J. Jewett, wrote: > David Mertz wrote: > > > Fwiw, I don't think it changes my order, but 'strict' is a better word > than > > 'equal' in all those places. I'd subtract 0.1 from each of those votes if > > they used "equal". > > I would say that 'equal' is worse t

[Python-Dev] Re: PEP 618: Add Optional Length-Checking To zip

2020-06-01 Thread Ethan Furman
On 06/01/2020 04:36 AM, Nick Coghlan wrote: Reading this thread and the current PEP, the main question I had was whether it might be better to flip the sense of the flag and call it "truncate". So the status quo would be "truncate=True", while the ValueError could be requested by passing an e

[Python-Dev] type() does not call __prepare__?

2020-06-01 Thread Ethan Furman
From stackoverflow [1] # metaprepare.py class Meta1(type): @classmethod def __prepare__(mcs, name, bases): print('call prepare') return {} def __new__(mcs, name, bases, parameters): return super().__new__(mcs, name, bases, parameters) class A

[Python-Dev] Re: Repr: where to place the address and additional info?

2020-06-01 Thread Brett Cannon
Serhiy Storchaka wrote: > The default repr of Python object is formatted using the following pattern: > <{typename} object at {address:#x}> > > And many custom reprs use similar patterns, but add some additional type > specific information. The type name first, followed by details and > address

[Python-Dev] Re: type() does not call __prepare__?

2020-06-01 Thread Joao S. O. Bueno
But on calling `type` in this way, you are passing the namespace as a ready object, as the 3rdy parameter - what would `__prepare__` even do, besides print it's been called? For sometime (maybe Python 3.3, I forgot), some helper callables where added to the `types` module to allow one to have more

[Python-Dev] Re: PEP 618: Add Optional Length-Checking To zip

2020-06-01 Thread Steven D'Aprano
On Mon, Jun 01, 2020 at 09:36:40PM +1000, Nick Coghlan wrote: > zip() can be used to combine iterables of different lengths, including > combining finite iterables with infinite iterators. By default, the output > iterator is implicitly truncated to produce the same number of items as the > shorte