Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 43ed80e

Browse files
committed
Improvements to docs formatting.
1 parent 23b8d0b commit 43ed80e

19 files changed

Lines changed: 316 additions & 270 deletions

IPython/core/completer.py

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -24,26 +24,26 @@
2424
Notes:
2525
2626
- Exceptions raised by the completer function are *ignored* (and
27-
generally cause the completion to fail). This is a feature -- since
28-
readline sets the tty device in raw (or cbreak) mode, printing a
29-
traceback wouldn't work well without some complicated hoopla to save,
30-
reset and restore the tty state.
27+
generally cause the completion to fail). This is a feature -- since
28+
readline sets the tty device in raw (or cbreak) mode, printing a
29+
traceback wouldn't work well without some complicated hoopla to save,
30+
reset and restore the tty state.
3131
3232
- The evaluation of the NAME.NAME... form may cause arbitrary
33-
application defined code to be executed if an object with a
34-
__getattr__ hook is found. Since it is the responsibility of the
35-
application (or the user) to enable this feature, I consider this an
36-
acceptable risk. More complicated expressions (e.g. function calls or
37-
indexing operations) are *not* evaluated.
33+
application defined code to be executed if an object with a
34+
``__getattr__`` hook is found. Since it is the responsibility of the
35+
application (or the user) to enable this feature, I consider this an
36+
acceptable risk. More complicated expressions (e.g. function calls or
37+
indexing operations) are *not* evaluated.
3838
3939
- GNU readline is also used by the built-in functions input() and
40-
raw_input(), and thus these also benefit/suffer from the completer
41-
features. Clearly an interactive application can benefit by
42-
specifying its own completer function and using raw_input() for all
43-
its input.
40+
raw_input(), and thus these also benefit/suffer from the completer
41+
features. Clearly an interactive application can benefit by
42+
specifying its own completer function and using raw_input() for all
43+
its input.
4444
4545
- When the original stdin is not a tty device, GNU readline is never
46-
used, and this module (and the readline module) are silently inactive.
46+
used, and this module (and the readline module) are silently inactive.
4747
"""
4848

4949
#*****************************************************************************
@@ -441,17 +441,17 @@ def __init__(self, shell=None, namespace=None, global_namespace=None,
441441
Inputs:
442442
443443
- shell: a pointer to the ipython shell itself. This is needed
444-
because this completer knows about magic functions, and those can
445-
only be accessed via the ipython instance.
444+
because this completer knows about magic functions, and those can
445+
only be accessed via the ipython instance.
446446
447447
- namespace: an optional dict where completions are performed.
448448
449449
- global_namespace: secondary optional dict for completions, to
450-
handle cases (such as IPython embedded inside functions) where
451-
both Python scopes are visible.
450+
handle cases (such as IPython embedded inside functions) where
451+
both Python scopes are visible.
452452
453453
- If alias_table is supplied, it should be a dictionary of aliases
454-
to complete.
454+
to complete.
455455
456456
use_readline : bool, optional
457457
If true, use the readline library. This completer can still function

IPython/core/debugger.py

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -96,19 +96,24 @@ class Tracer(object):
9696
def __init__(self,colors=None):
9797
"""Create a local debugger instance.
9898
99-
:Parameters:
99+
Parameters
100+
----------
100101
101-
- `colors` (None): a string containing the name of the color scheme to
102-
use, it must be one of IPython's valid color schemes. If not given, the
103-
function will default to the current IPython scheme when running inside
104-
IPython, and to 'NoColor' otherwise.
102+
colors : str, optional
103+
The name of the color scheme to use, it must be one of IPython's
104+
valid color schemes. If not given, the function will default to
105+
the current IPython scheme when running inside IPython, and to
106+
'NoColor' otherwise.
105107
106-
Usage example:
108+
Examples
109+
--------
110+
::
107111
108-
from IPython.core.debugger import Tracer; debug_here = Tracer()
112+
from IPython.core.debugger import Tracer; debug_here = Tracer()
109113
110-
... later in your code
111-
debug_here() # -> will open up the debugger at that point.
114+
Later in your code::
115+
116+
debug_here() # -> will open up the debugger at that point.
112117
113118
Once the debugger activates, you can use all of its regular commands to
114119
step through code, set breakpoints, etc. See the pdb documentation

IPython/core/interactiveshell.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -907,9 +907,9 @@ def debugger(self,force=False):
907907
Keywords:
908908
909909
- force(False): by default, this routine checks the instance call_pdb
910-
flag and does not actually invoke the debugger if the flag is false.
911-
The 'force' option forces the debugger to activate even if the flag
912-
is false.
910+
flag and does not actually invoke the debugger if the flag is false.
911+
The 'force' option forces the debugger to activate even if the flag
912+
is false.
913913
"""
914914

915915
if not (force or self.call_pdb):
@@ -2978,7 +2978,7 @@ def mktempfile(self, data=None, prefix='ipython_edit_'):
29782978
Optional inputs:
29792979
29802980
- data(None): if data is given, it gets written out to the temp file
2981-
immediately, and the file is closed again."""
2981+
immediately, and the file is closed again."""
29822982

29832983
filename = tempfile.mktemp('.py', prefix)
29842984
self.tempfiles.append(filename)
@@ -3021,13 +3021,14 @@ def extract_input_lines(self, range_str, raw=False):
30213021
30223022
Optional Parameters:
30233023
- raw(False): by default, the processed input is used. If this is
3024-
true, the raw input history is used instead.
3024+
true, the raw input history is used instead.
30253025
30263026
Note that slices can be called with two notations:
30273027
30283028
N:M -> standard python form, means including items N...(M-1).
30293029
3030-
N-M -> include items N..M (closed endpoint)."""
3030+
N-M -> include items N..M (closed endpoint).
3031+
"""
30313032
lines = self.history_manager.get_range_by_str(range_str, raw=raw)
30323033
return "\n".join(x for _, _, x in lines)
30333034

IPython/core/logger.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,11 +171,11 @@ def log(self, line_mod, line_ori):
171171
Inputs:
172172
173173
- line_mod: possibly modified input, such as the transformations made
174-
by input prefilters or input handlers of various kinds. This should
175-
always be valid Python.
174+
by input prefilters or input handlers of various kinds. This should
175+
always be valid Python.
176176
177-
- line_ori: unmodified input line from the user. This is not
178-
necessarily valid Python.
177+
- line_ori: unmodified input line from the user. This is not
178+
necessarily valid Python.
179179
"""
180180

181181
# Write the log line, but decide which one according to the

IPython/core/magic.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -489,11 +489,11 @@ class Magics(object):
489489
MUST:
490490
491491
- Use the method decorators `@line_magic` and `@cell_magic` to decorate
492-
individual methods as magic functions, AND
492+
individual methods as magic functions, AND
493493
494494
- Use the class decorator `@magics_class` to ensure that the magic
495-
methods are properly registered at the instance level upon instance
496-
initialization.
495+
methods are properly registered at the instance level upon instance
496+
initialization.
497497
498498
See :mod:`magic_functions` for examples of actual implementation classes.
499499
"""

0 commit comments

Comments
 (0)