Show More
@@ -252,6 +252,9 b" def autoreload_f(self, parameter_s=''):" | |||
|
252 | 252 | %autoreload |
|
253 | 253 | Reload all modules (except those excluded by %aimport) automatically now. |
|
254 | 254 | |
|
255 | %autoreload 0 | |
|
256 | Disable automatic reloading. | |
|
257 | ||
|
255 | 258 | %autoreload 1 |
|
256 | 259 | Reload all modules imported with %aimport every time before executing |
|
257 | 260 | the Python code typed. |
@@ -260,14 +263,15 b" def autoreload_f(self, parameter_s=''):" | |||
|
260 | 263 | Reload all modules (except those excluded by %aimport) every time |
|
261 | 264 | before executing the Python code typed. |
|
262 | 265 | |
|
263 |
Reloading Python modules in a reliable way is in general |
|
|
264 |
and unexpected things may occur. %autoreload tries to |
|
|
265 |
around common pitfalls by replacing code objects |
|
|
266 |
previously in the module with new versions. This |
|
|
267 | things to work: | |
|
266 | Reloading Python modules in a reliable way is in general | |
|
267 | difficult, and unexpected things may occur. %autoreload tries to | |
|
268 | work around common pitfalls by replacing function code objects and | |
|
269 | parts of classes previously in the module with new versions. This | |
|
270 | makes the following things to work: | |
|
268 | 271 | |
|
269 | 272 | - Functions and classes imported via 'from xxx import foo' are upgraded |
|
270 | 273 | to new versions when 'xxx' is reloaded. |
|
274 | ||
|
271 | 275 | - Methods and properties of classes are upgraded on reload, so that |
|
272 | 276 | calling 'c.foo()' on an object 'c' created before the reload causes |
|
273 | 277 | the new code for 'foo' to be executed. |
@@ -277,8 +281,10 b" def autoreload_f(self, parameter_s=''):" | |||
|
277 | 281 | - Replacing code objects does not always succeed: changing a @property |
|
278 | 282 | in a class to an ordinary method or a method to a member variable |
|
279 | 283 | can cause problems (but in old objects only). |
|
284 | ||
|
280 | 285 | - Functions that are removed (eg. via monkey-patching) from a module |
|
281 | 286 | before it is reloaded are not upgraded. |
|
287 | ||
|
282 | 288 | - C extension modules cannot be reloaded, and so cannot be |
|
283 | 289 | autoreloaded. |
|
284 | 290 |
General Comments 0
You need to be logged in to leave comments.
Login now