1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/docs/issues.txt Sun Oct 14 22:46:10 2007 +0200
1.3 @@ -0,0 +1,36 @@
1.4 +Code Generation and Optimisation Issues
1.5 +=======================================
1.6 +
1.7 +Python's dynamic nature provides a few issues which obstruct the generation of
1.8 +optimised code.
1.9 +
1.10 +Attribute and Method Selection
1.11 +------------------------------
1.12 +
1.13 +Python provides a kind of shadowing of attributes so that objects which do not
1.14 +provide a particular attribute can still appear to provide such an attribute
1.15 +via the object's class or base classes. If access via the object or the class
1.16 +are both possible for a particular case, two different kinds of access would
1.17 +need to be provided at that location in the program.
1.18 +
1.19 +Unlike other languages, methods and non-method attributes are interchangeable
1.20 +and are provided by objects or classes. Consequently, distinctions between
1.21 +attributes and methods, with special rules for method selection (virtual vs.
1.22 +non-virtual) do not exist. Moreover, unlike some languages such as C++ where
1.23 +explicit qualification of an object's type can be used to reference an
1.24 +attribute - for example, by saying that an object is of type X, an attribute
1.25 +can be located using knowledge of the structure of instances of X - such
1.26 +qualification does not take place in Python programs, and such knowledge must
1.27 +be provided by other means.
1.28 +
1.29 +Parameter Structures
1.30 +--------------------
1.31 +
1.32 +Python provides some complicated ways of passing parameters to functions and
1.33 +methods, such as keyword arguments and "overflow" parameters (star and dstar
1.34 +parameters). Consequently, if parameter values are to be put on a stack and
1.35 +given to a function, resolution of keyword arguments and "excess" arguments
1.36 +(of both positional and keyword varieties) must take place. This is made even
1.37 +more complicated by the possibility that at a given invocation site, many
1.38 +potentially incompatible functions may be called, each with their own optimal
1.39 +parameter ordering.