[Python-Dev] PEP 550 v4 (original) (raw)

Barry Warsaw barry at python.org
Sat Aug 26 12:30:10 EDT 2017


I agree with David; this PEP has really gotten to a great place and the new organization makes it much easier to understand.

On Aug 25, 2017, at 22:19, Ethan Furman <ethan at stoneleaf.us> wrote:

Why "lookup" and not "get" ? Many APIs use "get" and it's functionality is well understood.

I have the same question as Sven as to why we can’t have attribute access semantics. I probably asked that before, and you probably answered, so maybe if there’s a specific reason why this can’t be supported, the PEP should include a “rejected ideas” section explaining the choice.

That said, if we have to use method lookup, then I agree that .get() is a better choice than .lookup(). But in that case, would it be possible to add an optional default=None argument so that you can specify a marker object for a missing value? I worry that None might be a valid value in some cases, but that currently can’t be distinguished from “missing”.

I’d also like a debugging interface, such that I can ask “context_var.get()” and get some easy diagnostics about the resolution order.

Cheers, -Barry

-------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: Message signed with OpenPGP URL: <http://mail.python.org/pipermail/python-dev/attachments/20170826/36e11b71/attachment.sig>



More information about the Python-Dev mailing list