Doc magic pdef #229

Closed
wants to merge 2 commits into
from
Jump to file or symbol
Failed to load files and symbols.
+32 −3
Split
View
@@ -578,7 +578,19 @@ def magic_pinfo2(self, parameter_s='', namespaces=None):
def magic_pdef(self, parameter_s='', namespaces=None):
"""Print the definition header for any callable object.
- If the object is a class, print the constructor information."""
+ If the object is a class, print the constructor information.
+
+ Examples
+ --------
+ In [6]: %pdef hist
+ hist(self, parameter_s='')
@takluyver

takluyver Feb 13, 2011

Owner

Let's do the example inspecting a user defined function, rather than a magic function from IPython.

+
+ In [7]: %pdef pinfo
+ pinfo(self, parameter_s='', namespaces=None)
+
+
+
+ """
self._inspect('pdef',parameter_s, namespaces)
def magic_pdoc(self, parameter_s='', namespaces=None):
@@ -2366,7 +2378,21 @@ def magic_colors(self,parameter_s = ''):
Currently implemented schemes: NoColor, Linux, LightBG.
- Color scheme names are not case-sensitive."""
+ Color scheme names are not case-sensitive.
+
+ Usage
+ ------
+ %colors nocolor # It changes the color scheme for prompts, info system and exception handlers.Thus prompts, etc..
+
+ will be displayed as normal text.
+
+ %usage lightbg # It changes the color scheme for prompts, info system and exception handlers to light blue color.
@takluyver

takluyver Feb 13, 2011

Owner

These should probably be %colors. But I think one example (with a short comment) is enough, anyway.

+
+ %usage linux # It changes the color scheme for prompts, info system and exception handlers to green color.
+
+
+
+ """
def color_switch_err(name):
warn('Error changing %s color schemes.\n%s' %
@@ -2432,7 +2458,10 @@ def magic_Pprint(self, parameter_s=''):
['OFF','ON'][self.shell.pprint]
def magic_Exit(self, parameter_s=''):
- """Exit IPython."""
+ """
+ examples
@takluyver

takluyver Feb 13, 2011

Owner

This bit is superfluous.

+
+ Exit IPython."""
self.shell.ask_exit()