Movatterモバイル変換


[0]ホーム

URL:


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

Nick Coghlanncoghlan at gmail.com
Tue Nov 28 23:55:37 EST 2017


On 29 November 2017 at 03:13, Brett Cannon <brett at python.org> wrote:> On Tue, 28 Nov 2017 at 03:33 Nick Coghlan <ncoghlan at gmail.com> wrote:>> 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.The issue ishttps://bugs.python.org/issue27172, but the undeprecationisn't a Python 2/3 issue, it's a "tuples, lists and dicts are reallyhandy representations of things, and Python developers often preferthem to more structured objects" issue.The modern inspect.getfullargspec implementation is a relatively thinwrapper around inspect.signature, and the only lossy part of theoutput transformation is that you can't tell the difference betweenpositional-only and positional-or-keyword parameters.Cheers,Nick.-- Nick Coghlan   |ncoghlan at gmail.com   |   Brisbane, Australia


More information about the Python-Devmailing list

[8]ページ先頭

©2009-2025 Movatter.jp