[Python-Dev] PEP 362: 4th edition (original) (raw)
Nick Coghlan ncoghlan at gmail.com
Mon Jun 18 09:49:09 CEST 2012
- Previous message: [Python-Dev] PEP 362: 4th edition
- Next message: [Python-Dev] PEP 362: 4th edition
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Mon, Jun 18, 2012 at 5:08 PM, Jim Jewett <jimjjewett at gmail.com> wrote:
But perhaps they should know their relative position.
No, relative position is a property of the Signature - a parameter has no position until it is made part of a signature.
Also, positionalonly, *args, and **kwargs should be able to remove name from the list of compared attributes.
As you yourself said, removing the name from consideration for positional arguments is potentially dangerous - a function that accepts (source, dest) is very different from one that accepts (dest, source). If you don't care about names, then call bind() to see if it works or write your own more permissive comparison operation. If you do care about names, then the default equality definition is appropriate.
Ultimately, people are going to be free to do their own thing. The heart of the new API is to get all of this already available information out into a more conveniently manipulable format. Once we see what people do with it, then it is time to discuss additional convenience APIs (such as Signature level properties for parameter subsets).
Don't overengineer it at the foundational level - let people build their own additional layers of customisation on top.
Cheers, Nick.
-- Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia
- Previous message: [Python-Dev] PEP 362: 4th edition
- Next message: [Python-Dev] PEP 362: 4th edition
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]