A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2003-October/038866.html below:

[Python-Dev] accumulator display syntax

[Python-Dev] accumulator display syntaxAlex Martelli aleaxit at yahoo.com
Fri Oct 17 13:03:42 EDT 2003
On Friday 17 October 2003 06:38 pm, Skip Montanaro wrote:
   ...
>     Alex> ... just as e.g. foo[ 'va':23:2j, {'zip':'zop'}:45:(3,4) ] ...
>
> I have absolutely no idea how to interpret this.  Is this existing or
> proposed Python syntax?

Perfectly valid and current existing Python syntax:

>>> class F(object):
...   def __getitem__(self, x): return x
...
>>> foo=F()
>>> foo[ 'va':23:2j, {'zip':'zop'}:45:(3,4) ]
(slice('va', 23, 2j), slice({'zip': 'zop'}, 45, (3, 4)))

Not particularly _sensible_, mind you, and I hope nobody's yet
written any container that IS to be indexed by such tuples of
slices of multifarious nature.  But, indexing does stretch quite
far in the current Python syntax and semantics (in Python's
*pragmatics* you're supposed to use it far more restrainedly).


Alex


More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4