--
You received this message because you are subscribed to the Google Groups "MathFuture" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mathfuture+...@googlegroups.com.
To post to this group, send email to mathf...@googlegroups.com.
Visit this group at https://groups.google.com/group/mathfuture.
For more options, visit https://groups.google.com/d/optout.
Kirby,I feel technology passing my by!So suppose I want to create a blog with Jupyter notebooks.How do I go about it?I have a web host but I don't know if it knows about Jupyter.I've been using WordPress for my blog.I also have a github account, but I'm not sure how to blog with it.Can I replace WordPress with Jupyter?Would I be better off to use Google for my blog?Of course we are communicating now with Google Groups.Can we do Jupyter in Google Groups?Where can I go for a tutorial, or a class?Joe Austin
Good work! Very powerful technology, Jupyter. Your examples are very clear. Is the __repr__ method what makes the class a decorator?
On Saturday, June 11, 2016 at 12:21:47 PM UTC-7, kirby urner wrote:@thekirbster(goes to nbviewer, a public renderer of Jupyter Notebooks saved elsewhere -- in this case at my Github account)Kirby
What makes a class a decorator is its willingness to both eat a callable and return a callable, where a callable is any object that "eats" (takes arguments, or may be called without one using parens e.g. compose())."Eating" a callable function with a decorator class involves ingesting it through __init__ and returning and instance that implements __call__ (the special method for objects that need to eat arguments).The pattern:class Compose:def __init__(self, callable):self.callable = callable # <--- store incoming functiondef __call__(self, var):return self.callable(var) # <-- the returned instance eats vars@Composedef G(x):return x + 2 # random function, behavior will seem unaffected in this caseI could always add a __repr__ to Compose above.Kirby