On Tue, 26 Oct 2021, Eric V. Smith wrote:
You may or may not recall that a big reason for the removal of "tuple
parameter unpacking" in PEP 3113 was that they couldn't be supported by the
inspect module. Quoting that PEP: "Python has very powerful introspection
capabilities. These extend to function signatures. There are no hidden
details as to what a function's call signature is."
(Aside: I loved tuple parameter unpacking, and used it all the time! I was
sad to see them go, but I agreed with PEP 3113.)
Having recently heard a friend say "the removal of tuple parameter unpacking
was one thing that Python 3 got wrong", I read this and PEP 3113 with
interest.
It seems like another approach would be to treat tuple-unpacking parameters as
positional-only, now that this is a thing, or perhaps require that they are
explicitly positional-only via in PEP 570:
def move((x, y), /): ... # could be valid?
def move((x, y)): ... # could remain invalid?
Is it worth revisiting parameter tuple-unpacking in the age of positional-only
arguments? Or is this still a no-go from the perspective of introspection,
because it violates "There are no hidden details as to what a function's call
signature is."? (This may be a very short-lived thread.)
Erik
--
Erik Demaine | edema...@mit.edu | http://erikdemaine.org/
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/python-ideas@python.org/message/4DEUPSGXRJMB4TWGVLEZUEOCZUX3TNMS/
Code of Conduct: http://python.org/psf/codeofconduct/