diff --git a/develop/doc/html/index.html b/develop/doc/html/index.html index 5301b297..3bc6bfd0 100644 --- a/develop/doc/html/index.html +++ b/develop/doc/html/index.html @@ -126,7 +126,7 @@

- +

Last revised: June 04, 2018 at 14:42:11 GMT

Last revised: June 08, 2018 at 19:14:40 GMT


diff --git a/develop/doc/html/numpy/.doctrees/environment.pickle b/develop/doc/html/numpy/.doctrees/environment.pickle index a6489db7..cae699d7 100644 Binary files a/develop/doc/html/numpy/.doctrees/environment.pickle and b/develop/doc/html/numpy/.doctrees/environment.pickle differ diff --git a/develop/doc/html/reference/index.html b/develop/doc/html/reference/index.html index 76f9e76d..0770de4a 100644 --- a/develop/doc/html/reference/index.html +++ b/develop/doc/html/reference/index.html @@ -127,7 +127,7 @@ - +

Last revised: June 04, 2018 at 14:42:17 GMT

Last revised: June 08, 2018 at 19:14:46 GMT


diff --git a/develop/doc/html/tutorial/index.html b/develop/doc/html/tutorial/index.html index a6e55a30..cf1b84e3 100644 --- a/develop/doc/html/tutorial/index.html +++ b/develop/doc/html/tutorial/index.html @@ -140,7 +140,7 @@ - +

Last revised: June 04, 2018 at 14:42:14 GMT

Last revised: June 08, 2018 at 19:14:43 GMT


diff --git a/develop/doc/html/tutorial/tutorial/techniques.html b/develop/doc/html/tutorial/tutorial/techniques.html index 1081efe3..328c7ced 100644 --- a/develop/doc/html/tutorial/tutorial/techniques.html +++ b/develop/doc/html/tutorial/tutorial/techniques.html @@ -288,38 +288,6 @@ the interface) -

- You can even add a little syntactic sugar with the use of metaclasses. Let's - create a special metaclass that "injects" methods in other classes. -

-
# The one Boost.Python uses for all wrapped classes.
-# You can use here any class exported by Boost instead of "point"
-BoostPythonMetaclass = point.__class__
-
-class injector(object):
-    class __metaclass__(BoostPythonMetaclass):
-        def __init__(self, name, bases, dict):
-            for b in bases:
-                if type(b) not in (self, type):
-                    for k,v in dict.items():
-                        setattr(b,k,v)
-            return type.__init__(self, name, bases, dict)
-
-# inject some methods in the point foo
-class more_point(injector, point):
-    def __repr__(self):
-        return 'Point(x=%s, y=%s)' % (self.x, self.y)
-    def foo(self):
-        print 'foo!'
-
-

- Now let's see how it got: -

-
>>> print point()
-Point(x=10, y=10)
->>> point().foo()
-foo!
-

Another useful idea is to replace constructors with factory functions: