summaryrefslogtreecommitdiff
path: root/mtraits
diff options
context:
space:
mode:
authormichele.simionato <devnull@localhost>2008-08-31 08:42:16 +0000
committermichele.simionato <devnull@localhost>2008-08-31 08:42:16 +0000
commitb4bdd0e25d096301c4b222dbec1b7fb6f5190dbb (patch)
treebb50e4b98ca5ce9a9b65ce142c7500d9bc3fcbbe /mtraits
parent4cc02fc4a03b9420c5a657ef6039809a0d762216 (diff)
downloadmicheles-b4bdd0e25d096301c4b222dbec1b7fb6f5190dbb.tar.gz
Improve the enhanced_include example thanks to input from Nick Coghlan
Diffstat (limited to 'mtraits')
-rw-r--r--mtraits/docs.py6
1 files changed, 1 insertions, 5 deletions
diff --git a/mtraits/docs.py b/mtraits/docs.py
index 9326cb8..cd0a4ba 100644
--- a/mtraits/docs.py
+++ b/mtraits/docs.py
@@ -582,10 +582,6 @@ Then, you can define your own enhanced include as follows:
$$enhanced_include
-The syntax ``**{'MetaTOS': ExtendedMetaTOS}`` is ugly, but if you
-upgrade to Python 2.6 you will be able to use ``MetaTOS=ExtendedMetaTOS``
-since the parsing of keyword arguments has been improved.
-
In simple cases using directly ``ThirdPartyMeta`` may work, but I strongly
recommend to replace the call to super with ``__super`` even in
``ThirdPartyMeta`` to make the cooperation robust.
@@ -799,7 +795,7 @@ class ExtendedMetaTOS(ThirdPartyMeta):
__metaclass__ = include(MetaTOS)
def enhanced_include(*traits):
- return include(*traits, **{'MetaTOS': ExtendedMetaTOS})
+ return include(MetaTOS=ExtendedMetaTOS, *traits)
class FrameworkMeta(type): # example metaclass
def __new__(mcl, name, bases, dic):