[Python-Dev] PEP 362: 4th edition

Yury Selivanov yselivanov.ml at gmail.com
Tue Jun 19 04:35:06 CEST 2012


On 2012-06-18, at 10:06 PM, Nick Coghlan wrote:

> On Tue, Jun 19, 2012 at 12:00 PM, Yury Selivanov
> <yselivanov.ml at gmail.com> wrote:
>> On 2012-06-18, at 9:36 PM, Nick Coghlan wrote:
>>> So keep the current copying semantics for Signature objects (i.e.
>>> creating new copies of the Parameter objects as well), but call it a
>>> shallow copy rather than a deep copy. Make it clear in the
>>> documentation that any defaults and annotations are still shared with
>>> the underlying callable.
>> 
>> So, 'Signature.__deepcopy__()' -> 'Signature.shallow_copy()'?  Or make
>> it private - 'Signature._shallow_copy()'?
> 
> I'd just call it Signature.__copy__ :)
> 
> You're not doing anything unusual here, just declaring that the list
> of parameters is a part of the Signature object's state, and thus even
> a shallow copy shouldn't share the parameter objects.

OK, done ;)

BTW, http://bugs.python.org/issue15008 has the latest implementation
attached (if anybody wants to play with it)

-
Yury


More information about the Python-Dev mailing list