[Python-ideas] Delegating `BoundArguments.__getitem__` to `BoundArguments.arguments.__getitem__`

Ram Rachum ram at rachum.com
Fri Oct 3 18:51:51 CEST 2014


And while we're at it, if the user tries to access an argument that isn't
given but has a default, let's return the default.

On Fri, Oct 3, 2014 at 7:30 PM, Ram Rachum <ram at rachum.com> wrote:

> Hi,
>
> I suggest delegating `BoundArguments.__getitem__` to
> `BoundArguments.arguments.__getitem__`, so instead of doing
> `bound_arguments.arguments['foo']` we could do `bound_arguments['foo']`.
> Since there isn't that much more to a `BoundArguments` object than its
> arguments I think it's nice to save some typing and be able to access the
> arguments directly.
>
>
> Thanks,
> Ram.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20141003/52fe3db1/attachment.html>


More information about the Python-ideas mailing list