Skip to content

Commit cacc4a6

Browse files
Update python-minsky.md
1 parent 45983f4 commit cacc4a6

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

python-minsky.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,13 @@ You can set/get their values like any other C++ type, but if you attempt to set
6969
### Method calls
7070
C++ methods are called, and passed python parameters are converted into their C++ equivalents where possible, and an exception thrown where not. Mostly, the obvious thing will work, but some peculiarities can occur. For example if a method is overloaded with both an int argument and a double argument, then calling the method on 3 will call the int version, but calling it on 3.0 will call the double version. Sometimes it can be non-obvious which method will be called, so some experimentation is in order. Structs, and class public members on parameters can be set by passing a dict object. members not set within the dict are set to the default values, as though default constructed in C++.
7171

72+
## Introspection and Minsky API
73+
74+
Introspection is possible on any C++ object by the following methods:
75+
- `_list()`: return a list of methods/attributes available on the object
76+
- `_signature()`: return and arguments types for all overloads of a function
77+
- `_type()`: type of the object. This is a C++ name, but allows you to look up the type in the [API documentation](https://minsky.sourceforge.io/doxydoc/html/index.html)
78+
- `keys()`: returns the list of keys of a map object (eg std::map, std::unordered_map, etc).
79+
- `pyminsky.enum`: is a dict containing all enumerators for all enums registered in the system
80+
81+
Minsky is open source, so ultimately the documented API is found by consulting the source code. However, as useful annotated API summary is created by running the Doxygen tool in the top level directory, [the results of which for the latest release can be found online](https://minsky.sourceforge.io/doxydoc/html/index.html).

0 commit comments

Comments
 (0)