[Python-Dev] Can Python guarantee the order of keyword-only parameters?

Steve Holden steve at holdenweb.com
Tue Nov 28 13:25:01 EST 2017


I was going to suggest the final DeprecationWarning should be raised
unconditionally (subject to whatever silencing rules are agreed) by the
final 2.7 release to recommend migration to Python 3.

"This is an ex-language ... it has ceased to be ... it is no more ... it
has returned to the great heap whence it came ..."

Steve Holden

On Tue, Nov 28, 2017 at 5:13 PM, Brett Cannon <brett at python.org> wrote:

>
>
> On Tue, 28 Nov 2017 at 03:33 Nick Coghlan <ncoghlan at gmail.com> wrote:
>
>> On 28 November 2017 at 15:42, Larry Hastings <larry at hastings.org> wrote:
>> > On 11/27/2017 03:58 PM, Yury Selivanov wrote:
>> >> We can't say anything about the order if someone passes a partial
>> >> object
>> >
>> > Sure we could.  We could ensure that functools.partial behaves in a sane
>> > way, then document and guarantee that behavior.
>>
>> Right, I think the main implication here would be that we need to
>> ensure that any signature manipulation operations *we* provide are
>> order preserving.
>>
>> Fortunately for Larry, we kinda cheat on that front: all the logic for
>> dealing with this problem is in the inspect module itself, which knows
>> about all the different ways we manipulate signatures in the standard
>> library. That means that if we want to declare that the inspect module
>> will be order preserving, we can, and it shouldn't require changes to
>> anything else.
>>
>> Cheers,
>> Nick.
>>
>> P.S. Note that inspect.getfullargspec() was actually undeprecated a
>> while back - enough folks that didn't need access to the function
>> annotations were reimplementing it for themselves "because the
>> standard library API is deprecated" that the most logical course of
>> action was to just declare it as being supported again. I don't think
>> that changes the argument here though - it just means guaranteed order
>> preservation in that API will only happen if we declare dicts to be
>> insertion ordered in general.
>>
>
> OT for this thread, but is there an issue number tracking the
> un-deprecating? Basically I want to make sure there is an issue tracking
> deprecating it again when we stop worrying about any Python 2/3 support.
>
> _______________________________________________
> Python-Dev mailing list
> Python-Dev at python.org
> https://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe: https://mail.python.org/mailman/options/python-dev/
> steve%40holdenweb.com
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20171128/9369e9d1/attachment.html>


More information about the Python-Dev mailing list