__brace__ (PEP?)

Jp Calderone exarkun at divmod.com
Sun May 8 20:25:29 EDT 2005


On Sun, 8 May 2005 16:29:03 -0700, James Stroud <jstroud at mbi.ucla.edu> wrote:
>Hello All,
>
>If "__call__" allows anobject() and "__getitem__" allows anobject[arange], why
>not have "__brace__" (or some other, better name) for anobject{something}.
>Such braces might be useful for cross-sectioning nested data structures:
>

  See Numeric Python, which uses index slices in multiple dimensions to satisfy this use case.

  While a new syntactic construct could be introduced to provide this feature, the "minimal core, rich library" school of language design suggests that doing so would not be a great idea.

  Jp



More information about the Python-list mailing list