can also use '__name__.split(".")[-1]' to get the undotted form of |
can also use '__name__.split(".")[-1]' to get the undotted form of |
a class' name. |
a class' name. |
|
|
|
|
Special Considerations for Mutables and Dynamic Initialization |
Special Considerations for Mutables and Dynamic Initialization |
|
|
Both inheritance and patching are implemented by running hacked, |
Both inheritance and patching are implemented by running hacked, |
from peak.api import config |
from peak.api import config |
config.setupModule() |
config.setupModule() |
|
|
|
|
|
|
|
|
Limitations of Package Inheritance |
Limitations of Package Inheritance |
|
|
Because "package inheritance" is effectively just a '__path__' hack, |
Because "package inheritance" is effectively just a '__path__' hack, |
which isn't possible with a regular 'import' statement. |
which isn't possible with a regular 'import' statement. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Import Paths |
Import Paths |
|
|
To make using relative imports easier, '__bases__' can include |
To make using relative imports easier, '__bases__' can include |
there *does* need to be a reference-style explanation as well, that |
there *does* need to be a reference-style explanation as well, that |
describes the precise semantics of interpretation for assignments, |
describes the precise semantics of interpretation for assignments, |
'def', and 'class', in modules running under simulator control. |
'def', and 'class', in modules running under simulator control. |
|
|
|
|
|
|
|
|
|
* Allow 'declareModule()' to bootstrap non-existent modules; this might |
|
let us create "virtual packages" made by assembling other packages |
|
and modules. |
|
|
|
* Need a strategy for handling "del" operations; they are currently |
|
untrapped. This might be okay under most circumstances, but need to |
|
consider edge cases. |
|
|
|
* 'makeClass()' should probably become part of the core API, where |
|
it can be used to resolve __metaclass__ conflicts during the first |
|
pass of importing a module (prior to running 'setupModule()') |
""" |
""" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
from __future__ import generators |
from __future__ import generators |
import sys |
import sys |
from types import ModuleType |
from types import ModuleType |