Show More
@@ -68,20 +68,19 b' version_info = release.version_info' | |||
|
68 | 68 | |
|
69 | 69 | def embed_kernel(module=None, local_ns=None, **kwargs): |
|
70 | 70 | """Embed and start an IPython kernel in a given scope. |
|
71 | ||
|
71 | ||
|
72 | 72 | If you don't want the kernel to initialize the namespace |
|
73 | 73 | from the scope of the surrounding function, |
|
74 | 74 | and/or you want to load full IPython configuration, |
|
75 | 75 | you probably want `IPython.start_kernel()` instead. |
|
76 | ||
|
76 | ||
|
77 | 77 | Parameters |
|
78 | 78 | ---------- |
|
79 | 79 | module : types.ModuleType, optional |
|
80 | 80 | The module to load into IPython globals (default: caller) |
|
81 | 81 | local_ns : dict, optional |
|
82 | 82 | The namespace to load into IPython user namespace (default: caller) |
|
83 | ||
|
84 | kwargs : various, optional | |
|
83 | **kwargs : various, optional | |
|
85 | 84 | Further keyword args are relayed to the IPKernelApp constructor, |
|
86 | 85 | allowing configuration of the Kernel. Will only have an effect |
|
87 | 86 | on the first embed_kernel call for a given process. |
@@ -99,26 +98,25 b' def embed_kernel(module=None, local_ns=None, **kwargs):' | |||
|
99 | 98 | |
|
100 | 99 | def start_ipython(argv=None, **kwargs): |
|
101 | 100 | """Launch a normal IPython instance (as opposed to embedded) |
|
102 | ||
|
101 | ||
|
103 | 102 | `IPython.embed()` puts a shell in a particular calling scope, |
|
104 | 103 | such as a function or method for debugging purposes, |
|
105 | 104 | which is often not desirable. |
|
106 | ||
|
105 | ||
|
107 | 106 | `start_ipython()` does full, regular IPython initialization, |
|
108 | 107 | including loading startup files, configuration, etc. |
|
109 | 108 | much of which is skipped by `embed()`. |
|
110 | ||
|
109 | ||
|
111 | 110 | This is a public API method, and will survive implementation changes. |
|
112 | ||
|
111 | ||
|
113 | 112 | Parameters |
|
114 | 113 | ---------- |
|
115 | ||
|
116 | 114 | argv : list or None, optional |
|
117 | 115 | If unspecified or None, IPython will parse command-line options from sys.argv. |
|
118 | 116 | To prevent any command-line parsing, pass an empty list: `argv=[]`. |
|
119 | 117 | user_ns : dict, optional |
|
120 | 118 | specify this dictionary to initialize the IPython user namespace with particular values. |
|
121 | kwargs : various, optional | |
|
119 | **kwargs : various, optional | |
|
122 | 120 | Any other kwargs will be passed to the Application constructor, |
|
123 | 121 | such as `config`. |
|
124 | 122 | """ |
@@ -127,24 +125,23 b' def start_ipython(argv=None, **kwargs):' | |||
|
127 | 125 | |
|
128 | 126 | def start_kernel(argv=None, **kwargs): |
|
129 | 127 | """Launch a normal IPython kernel instance (as opposed to embedded) |
|
130 | ||
|
128 | ||
|
131 | 129 | `IPython.embed_kernel()` puts a shell in a particular calling scope, |
|
132 | 130 | such as a function or method for debugging purposes, |
|
133 | 131 | which is often not desirable. |
|
134 | ||
|
132 | ||
|
135 | 133 | `start_kernel()` does full, regular IPython initialization, |
|
136 | 134 | including loading startup files, configuration, etc. |
|
137 | 135 | much of which is skipped by `embed()`. |
|
138 | ||
|
136 | ||
|
139 | 137 | Parameters |
|
140 | 138 | ---------- |
|
141 | ||
|
142 | 139 | argv : list or None, optional |
|
143 | 140 | If unspecified or None, IPython will parse command-line options from sys.argv. |
|
144 | 141 | To prevent any command-line parsing, pass an empty list: `argv=[]`. |
|
145 | 142 | user_ns : dict, optional |
|
146 | 143 | specify this dictionary to initialize the IPython user namespace with particular values. |
|
147 | kwargs : various, optional | |
|
144 | **kwargs : various, optional | |
|
148 | 145 | Any other kwargs will be passed to the Application constructor, |
|
149 | 146 | such as `config`. |
|
150 | 147 | """ |
@@ -254,7 +254,7 b' class BaseIPythonApplication(Application):' | |||
|
254 | 254 | |
|
255 | 255 | def excepthook(self, etype, evalue, tb): |
|
256 | 256 | """this is sys.excepthook after init_crashhandler |
|
257 | ||
|
257 | ||
|
258 | 258 | set self.verbose_crash=True to use our full crashhandler, instead of |
|
259 | 259 | a regular traceback with a short message (crash_handler_lite) |
|
260 | 260 | """ |
@@ -41,9 +41,9 b' class IPyAutocall(object):' | |||
|
41 | 41 | |
|
42 | 42 | def set_ip(self, ip): |
|
43 | 43 | """ Will be used to set _ip point to current ipython instance b/f call |
|
44 | ||
|
44 | ||
|
45 | 45 | Override this method if you don't want this to happen. |
|
46 | ||
|
46 | ||
|
47 | 47 | """ |
|
48 | 48 | self._ip = ip |
|
49 | 49 |
@@ -118,12 +118,12 b' class CachingCompiler(codeop.Compile):' | |||
|
118 | 118 | Parameters |
|
119 | 119 | ---------- |
|
120 | 120 | raw_code : str |
|
121 | The raw cell code. | |
|
121 | The raw cell code. | |
|
122 | 122 | transformed_code : str |
|
123 | The executable Python source code to cache and compile. | |
|
123 | The executable Python source code to cache and compile. | |
|
124 | 124 | number : int |
|
125 | A number which forms part of the code's name. Used for the execution | |
|
126 | counter. | |
|
125 | A number which forms part of the code's name. Used for the execution | |
|
126 | counter. | |
|
127 | 127 | |
|
128 | 128 | Returns |
|
129 | 129 | ------- |
@@ -137,12 +137,12 b' class CachingCompiler(codeop.Compile):' | |||
|
137 | 137 | Parameters |
|
138 | 138 | ---------- |
|
139 | 139 | transformed_code : str |
|
140 | The executable Python source code to cache and compile. | |
|
140 | The executable Python source code to cache and compile. | |
|
141 | 141 | number : int |
|
142 | A number which forms part of the code's name. Used for the execution | |
|
143 | counter. | |
|
142 | A number which forms part of the code's name. Used for the execution | |
|
143 | counter. | |
|
144 | 144 | raw_code : str |
|
145 | The raw code before transformation, if None, set to `transformed_code`. | |
|
145 | The raw code before transformation, if None, set to `transformed_code`. | |
|
146 | 146 | |
|
147 | 147 | Returns |
|
148 | 148 | ------- |
@@ -431,9 +431,9 b' def _deduplicate_completions(text: str, completions: _IC)-> _IC:' | |||
|
431 | 431 | |
|
432 | 432 | Parameters |
|
433 | 433 | ---------- |
|
434 | text: str | |
|
434 | text : str | |
|
435 | 435 | text that should be completed. |
|
436 | completions: Iterator[Completion] | |
|
436 | completions : Iterator[Completion] | |
|
437 | 437 | iterator over the completions to deduplicate |
|
438 | 438 | |
|
439 | 439 | Yields |
@@ -474,9 +474,9 b' def rectify_completions(text: str, completions: _IC, *, _debug=False)->_IC:' | |||
|
474 | 474 | |
|
475 | 475 | Parameters |
|
476 | 476 | ---------- |
|
477 | text: str | |
|
477 | text : str | |
|
478 | 478 | text that should be completed. |
|
479 | completions: Iterator[Completion] | |
|
479 | completions : Iterator[Completion] | |
|
480 | 480 | iterator over the completions to rectify |
|
481 | 481 | |
|
482 | 482 | Notes |
@@ -763,13 +763,13 b' def match_dict_keys(keys: List[Union[str, bytes, Tuple[Union[str, bytes]]]], pre' | |||
|
763 | 763 | |
|
764 | 764 | Parameters |
|
765 | 765 | ---------- |
|
766 |
keys |
|
|
766 | keys | |
|
767 | 767 | list of keys in dictionary currently being completed. |
|
768 |
prefix |
|
|
768 | prefix | |
|
769 | 769 | Part of the text already typed by the user. E.g. `mydict[b'fo` |
|
770 |
delims |
|
|
770 | delims | |
|
771 | 771 | String of delimiters to consider when finding the current key. |
|
772 | extra_prefix: optional | |
|
772 | extra_prefix : optional | |
|
773 | 773 | Part of the text already typed in multi-key index cases. E.g. for |
|
774 | 774 | `mydict['foo', "bar", 'b`, this would be `('foo', 'bar')`. |
|
775 | 775 | |
@@ -993,7 +993,7 b' def _formatparamchildren(parameter) -> str:' | |||
|
993 | 993 | |
|
994 | 994 | Parameters |
|
995 | 995 | ---------- |
|
996 |
parameter |
|
|
996 | parameter | |
|
997 | 997 | Jedi's function `Param` |
|
998 | 998 | |
|
999 | 999 | Returns |
@@ -1013,7 +1013,7 b' def _make_signature(completion)-> str:' | |||
|
1013 | 1013 | |
|
1014 | 1014 | Parameters |
|
1015 | 1015 | ---------- |
|
1016 | completion: jedi.Completion | |
|
1016 | completion : jedi.Completion | |
|
1017 | 1017 | object does not complete a function type |
|
1018 | 1018 | |
|
1019 | 1019 | Returns |
@@ -1854,9 +1854,9 b' class IPCompleter(Completer):' | |||
|
1854 | 1854 | |
|
1855 | 1855 | Parameters |
|
1856 | 1856 | ---------- |
|
1857 | text:str | |
|
1857 | text : str | |
|
1858 | 1858 | Full text of the current input, multi line string. |
|
1859 | offset:int | |
|
1859 | offset : int | |
|
1860 | 1860 | Integer representing the position of the cursor in ``text``. Offset |
|
1861 | 1861 | is 0-based indexed. |
|
1862 | 1862 |
@@ -101,25 +101,19 b' class CrashHandler(object):' | |||
|
101 | 101 | |
|
102 | 102 | Parameters |
|
103 | 103 | ---------- |
|
104 |
app : |
|
|
104 | app : Application | |
|
105 | 105 | A running :class:`Application` instance, which will be queried at |
|
106 | 106 | crash time for internal information. |
|
107 | ||
|
108 | 107 | contact_name : str |
|
109 | 108 | A string with the name of the person to contact. |
|
110 | ||
|
111 | 109 | contact_email : str |
|
112 | 110 | A string with the email address of the contact. |
|
113 | ||
|
114 | 111 | bug_tracker : str |
|
115 | 112 | A string with the URL for your project's bug tracker. |
|
116 | ||
|
117 | 113 | show_crash_traceback : bool |
|
118 | 114 | If false, don't print the crash traceback on stderr, only generate |
|
119 | 115 | the on-disk report |
|
120 | ||
|
121 | Non-argument instance attributes: | |
|
122 | ||
|
116 | Non-argument instance attributes | |
|
123 | 117 | These instances contain some non-argument attributes which allow for |
|
124 | 118 | further customization of the crash handler's behavior. Please see the |
|
125 | 119 | source for further details. |
@@ -109,7 +109,6 b' class Tracer(object):' | |||
|
109 | 109 | |
|
110 | 110 | Parameters |
|
111 | 111 | ---------- |
|
112 | ||
|
113 | 112 | colors : str, optional |
|
114 | 113 | The name of the color scheme to use, it must be one of IPython's |
|
115 | 114 | valid color schemes. If not given, the function will default to |
@@ -62,7 +62,7 b' def publish_display_data(data, metadata=None, source=None, *, transient=None, **' | |||
|
62 | 62 | Unused. |
|
63 | 63 | transient : dict, keyword-only |
|
64 | 64 | A dictionary of transient data, such as display_id. |
|
65 |
|
|
|
65 | """ | |
|
66 | 66 | from IPython.core.interactiveshell import InteractiveShell |
|
67 | 67 | |
|
68 | 68 | display_pub = InteractiveShell.instance().display_pub |
@@ -133,12 +133,11 b' def display(' | |||
|
133 | 133 | clear : bool, optional |
|
134 | 134 | Should the output area be cleared before displaying anything? If True, |
|
135 | 135 | this will wait for additional output before clearing. [default: False] |
|
136 | kwargs: additional keyword-args, optional | |
|
136 | **kwargs : additional keyword-args, optional | |
|
137 | 137 | Additional keyword-arguments are passed through to the display publisher. |
|
138 | 138 | |
|
139 | 139 | Returns |
|
140 | 140 | ------- |
|
141 | ||
|
142 | 141 | handle: DisplayHandle |
|
143 | 142 | Returns a handle on updatable displays for use with :func:`update_display`, |
|
144 | 143 | if `display_id` is given. Returns :any:`None` if no `display_id` is given |
@@ -146,7 +145,6 b' def display(' | |||
|
146 | 145 | |
|
147 | 146 | Examples |
|
148 | 147 | -------- |
|
149 | ||
|
150 | 148 | >>> class Json(object): |
|
151 | 149 | ... def __init__(self, json): |
|
152 | 150 | ... self.json = json |
@@ -185,12 +183,10 b' def display(' | |||
|
185 | 183 | |
|
186 | 184 | See Also |
|
187 | 185 | -------- |
|
188 | ||
|
189 | 186 | :func:`update_display` |
|
190 | 187 | |
|
191 | 188 | Notes |
|
192 | 189 | ----- |
|
193 | ||
|
194 | 190 | In Python, objects can declare their textual representation using the |
|
195 | 191 | `__repr__` method. IPython expands on this idea and allows objects to declare |
|
196 | 192 | other, rich representations including: |
@@ -300,15 +296,13 b' def update_display(obj, *, display_id, **kwargs):' | |||
|
300 | 296 | |
|
301 | 297 | Parameters |
|
302 | 298 | ---------- |
|
303 | ||
|
304 | obj: | |
|
299 | obj | |
|
305 | 300 | The object with which to update the display |
|
306 | display_id: keyword-only | |
|
301 | display_id : keyword-only | |
|
307 | 302 | The id of the display to update |
|
308 | 303 | |
|
309 | 304 | See Also |
|
310 | 305 | -------- |
|
311 | ||
|
312 | 306 | :func:`display` |
|
313 | 307 | """ |
|
314 | 308 | kwargs['update'] = True |
@@ -343,10 +337,9 b' class DisplayHandle(object):' | |||
|
343 | 337 | |
|
344 | 338 | Parameters |
|
345 | 339 | ---------- |
|
346 | ||
|
347 | obj: | |
|
340 | obj | |
|
348 | 341 | object to display |
|
349 |
**kwargs |
|
|
342 | **kwargs | |
|
350 | 343 | additional keyword arguments passed to display |
|
351 | 344 | """ |
|
352 | 345 | display(obj, display_id=self.display_id, **kwargs) |
@@ -356,10 +349,9 b' class DisplayHandle(object):' | |||
|
356 | 349 | |
|
357 | 350 | Parameters |
|
358 | 351 | ---------- |
|
359 | ||
|
360 | obj: | |
|
352 | obj | |
|
361 | 353 | object to display |
|
362 |
**kwargs |
|
|
354 | **kwargs | |
|
363 | 355 | additional keyword arguments passed to update_display |
|
364 | 356 | """ |
|
365 | 357 | update_display(obj, display_id=self.display_id, **kwargs) |
General Comments 0
You need to be logged in to leave comments.
Login now