From 842667981577f1b45d5d30631572c09caff6b35b Mon Sep 17 00:00:00 2001 From: Travis CI Date: Wed, 11 Jul 2018 23:40:27 +0000 Subject: [PATCH] Deploy to GitHub Pages: 6f72675bff276599ffdccb9681018d8b2e367bc2 --- doc/html/index.html | 2 +- doc/html/numpy/.doctrees/environment.pickle | Bin 18348 -> 18348 bytes doc/html/reference/index.html | 2 +- doc/html/tutorial/index.html | 2 +- doc/html/tutorial/tutorial/techniques.html | 32 -------------------- 5 files changed, 3 insertions(+), 35 deletions(-) diff --git a/doc/html/index.html b/doc/html/index.html index be50f11b..85426fd1 100644 --- a/doc/html/index.html +++ b/doc/html/index.html @@ -126,7 +126,7 @@

- +

Last revised: April 18, 2018 at 01:55:50 GMT

Last revised: July 11, 2018 at 23:40:09 GMT


diff --git a/doc/html/numpy/.doctrees/environment.pickle b/doc/html/numpy/.doctrees/environment.pickle index 8da3dbea654a4cd5e235b7141f82fb749fcbb410..ea70a1541de30048910c33a2ca01e606bde07a04 100644 GIT binary patch delta 154 zcmZ3}&$yC>+%kC*cSak8 Ny>(^xW>%Nw%m5VaOxFMa delta 154 zcmZ3}&$yaK2f|ePJtxBy!c^YUnqdcFs>ChI zaECBuG=ee$AWW6L3o{}iOlhmSj3fwCA!2?;HiW5~6PZy0VJhWb%BY1fC6BXkXS6}s NQn#fxv$`y21^`mtMVJ5p diff --git a/doc/html/reference/index.html b/doc/html/reference/index.html index 352b010b..8f1569a6 100644 --- a/doc/html/reference/index.html +++ b/doc/html/reference/index.html @@ -127,7 +127,7 @@ - +

Last revised: April 18, 2018 at 01:55:56 GMT

Last revised: July 11, 2018 at 23:40:14 GMT


diff --git a/doc/html/tutorial/index.html b/doc/html/tutorial/index.html index 141d74d4..615b6dfa 100644 --- a/doc/html/tutorial/index.html +++ b/doc/html/tutorial/index.html @@ -140,7 +140,7 @@ - +

Last revised: April 18, 2018 at 01:55:53 GMT

Last revised: July 11, 2018 at 23:40:12 GMT


diff --git a/doc/html/tutorial/tutorial/techniques.html b/doc/html/tutorial/tutorial/techniques.html index 1081efe3..328c7ced 100644 --- a/doc/html/tutorial/tutorial/techniques.html +++ b/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: