OpenMaple/Python/Name/__getattr__ - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : OpenMaple/Python/Name/__getattr__

__getattr__

get attribute of Name

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

x.__getattr__(y)

x.y

Parameters

x

-

Name object

y

-

Name object

Description

• 

__getattr__ forms a Maple module reference given Maple Name objects x and y.

• 

This allows the use of the a.b syntax within Python to correspond to the colondash (:-) operator within Maple, allowing full access to the hierarchical Maple namespace.

Examples

The following interactive session implicitly uses __getattr__ to reference the function LinearAlgebra[Determinant] using the syntax maple.namespace.LinearAlgebra.Determinant.

>>> import maple

>>> import maple.namespace

>>> M = maple.execute('<<1,2>|<3,4>>:')

>>> det = maple.namespace.LinearAlgebra.Determinant

>>> det(M)

-2

See Also

OpenMaple

OpenMaple/Python/API

OpenMaple/Python/Expression

OpenMaple/Python/Name