[PYTHON MATRIX-SIG] Slice expressions

Konrad Hinsen hinsen@ibs.ibs.fr
Wed, 16 Oct 96 14:50:02 +0100


What happened to the slice generator that was in Numeric in earlier
versions? It seems to have disappeared, with no visible replacement.

Just in case someone else needs it, here's the definition that I just
put into my copy of Core.py:

----------------------------------------------------------------------
class _index_expression_class:

    def __getitem__(self, item):
        if type(item) != type(()):
            return (item,)
        else:
            return item

index_expression = _index_expression_class()
----------------------------------------------------------------------

-- 
-------------------------------------------------------------------------------
Konrad Hinsen                          | E-Mail: hinsen@ibs.ibs.fr
Laboratoire de Dynamique Moleculaire   | Tel.: +33-76.88.99.28
Institut de Biologie Structurale       | Fax:  +33-76.88.54.94
41, av. des Martyrs                    | Deutsch/Esperanto/English/
38027 Grenoble Cedex 1, France         | Nederlands/Francais
-------------------------------------------------------------------------------

=================
MATRIX-SIG  - SIG on Matrix Math for Python

send messages to: matrix-sig@python.org
administrivia to: matrix-sig-request@python.org
=================