Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tutorial example "A Slight Modification" - super() takes at least one argument #140

Closed
meowsqueak opened this issue Oct 27, 2013 · 3 comments · May be fixed by #913
Closed

Fix tutorial example "A Slight Modification" - super() takes at least one argument #140

meowsqueak opened this issue Oct 27, 2013 · 3 comments · May be fixed by #913

Comments

@meowsqueak
Copy link

Documentation error:

http://docs.enthought.com/chaco/user_manual/tutorial_1.html#a-slight-modification

Verbatim copy/paste in Canopy Editor results in:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
/Applications/Canopy.app/appdata/canopy-1.1.0.1371.macosx-x86_64/Canopy.app/Contents/lib/python2.7/site-packages/IPython/utils/py3compat.pyc in execfile(fname, *where)
    181             else:
    182                 filename = fname
--> 183             __builtin__.execfile(filename, *where)

.../tutorial1_5.py in ()
     21         self.plot = plot
     22 if __name__ == "__main__":
---> 23     OverlappingPlot().configure_traits()

.../tutorial1_5.py in __init__(self)
     11         width=500, height=500, resizable=True, title="Chaco Plot")
     12     def __init__(self):
---> 13         super(OverlappingPlot).__init__()
     14         x = linspace(-14, 14, 100)
     15         y = x/2 * sin(x)

TypeError: super() takes at least 1 argument (0 given)

Canopy 1.1.0-osx-64 on OSX 10.7.5.

@meowsqueak
Copy link
Author

The fix is simple: just add 'self' as the second parameter to the super(...) line:

super(OverlappingPlot, **self**).__init__()

@kjordahl
Copy link
Contributor

This has been fixed in the documentation source for a while: https://github.com/enthought/chaco/blame/master/docs/source/user_manual/chaco_tutorial.rst#L419

Somehow that link is showing an older build (v3.4.1). The current version is here: http://docs.enthought.com/chaco/user_manual/chaco_tutorial.html#multiple-plots

We should clean up the old links on docs.enthought.com.

@jonathanrocher
Copy link
Collaborator

Thanks for pointing this out @meowsqueak and @kjordahl. I am adding a review of the documentation on the roadmap for the next few months...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants