On Fri, Dec 3, 2021 at 2:27 PM Steven D'Aprano <st...@pearwood.info> wrote:
>
> On Fri, Dec 03, 2021 at 10:36:55AM +1100, Chris Angelico wrote:
>
> > Same again. If you consider the equivalent to be a line of code in the
> > function body, then the signature has become MASSIVELY more useful.
> > Instead of simply seeing "x=<object object at 0x7fba1b318690>", you
> > can see "x=>[]" and be able to see what the value would be. It's
> > primarily human-readable (although you could eval it),
>
> You: "it is impossible to evaluate the late-bound default outside of the
> function!"
>
> Also you: "Just eval the string."
>
> You can't have it both ways :-)
>

I'm saying that there's a certain level of machine-readability to it,
in the same way that a repr has that. You cannot, with full
generality, eval a repr to get the same result; yet I don't think
you'd call it a purely-human-readable representation of something.

What you get in the docs for a late-bound default is more
machine-readable than a repr (you could parse it to AST and expect to
get the same AST that originally compiled the code), which is a far
cry from "just human readable", but you can't actually eval it to
reliably reconstruct the default.

Please can we focus on whether the proposal is useful, and not on some
throwaway comment where I took a shorthand in clarifying how something
can be interpreted? No? Dangit, I must be on python-ideas :)

ChrisA
_______________________________________________
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/C5AGST7OWZWTVK2DZ65BABM4YESWYHVJ/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to