[issue42666] getting a class source regresses in Python 3.9

2020-12-17 Thread Thomas Viehmann
Thomas Viehmann added the comment: I might add that this is a case I hit in the PyTorch test suite. I tried to fix this a long time ago in a pricipled way in https://bugs.python.org/issue33826 and Guido explained that fixing it was too heavy handed to be worthwile in https://mail.python.org

[issue42666] getting a class source regresses in Python 3.9

2020-12-17 Thread Thomas Viehmann
New submission from Thomas Viehmann : getting a class source regresses in Python 3.9 onwards. The following worked in Python 3.8, now it doesn't anymore for 3.9.1 and 3.10.0a2: (save as foo.py) import inspect class Foo: def spam(self): global Bar clas

[issue33826] enable discovery of class source code in IPython interactively defined classes

2019-06-07 Thread Thomas Viehmann
Change by Thomas Viehmann : -- nosy: -t-vi resolution: -> rejected ___ Python tracker <https://bugs.python.org/issue33826> ___ ___ Python-bugs-list mai

[issue33826] enable discovery of class source code in IPython interactively defined classes

2019-06-07 Thread Thomas Viehmann
Change by Thomas Viehmann : -- stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue33826> ___ ___ Pyth

[issue33826] enable discovery of class source code in IPython interactively defined classes

2019-06-07 Thread Thomas Viehmann
Thomas Viehmann added the comment: Note that the module is less granular than the filename in IPython - i.e. it's useless for within notebooks. -- nosy: +t-vi ___ Python tracker <https://bugs.python.org/is

[issue33826] enable discovery of class source code in IPython interactively defined classes

2019-06-07 Thread Thomas Viehmann
Change by Thomas Viehmann : -- pull_requests: +13770 stage: -> patch review pull_request: https://github.com/python/cpython/pull/13894 ___ Python tracker <https://bugs.python.org/issu

[issue37177] IDLE: Search dialogs can be hidden behind the main window

2019-06-07 Thread Thomas Viehmann
Change by Thomas Viehmann : -- pull_requests: +13768 pull_request: https://github.com/python/cpython/pull/13894 ___ Python tracker <https://bugs.python.org/issue37

[issue33826] enable discovery of class source code in IPython interactively defined classes

2018-11-10 Thread Thomas Viehmann
Change by Thomas Viehmann : -- resolution: duplicate -> ___ Python tracker <https://bugs.python.org/issue33826> ___ ___ Python-bugs-list mailing list Un

[issue33826] enable discovery of class source code in IPython interactively defined classes

2018-10-29 Thread Thomas Viehmann
Change by Thomas Viehmann : -- nosy: -t-vi ___ Python tracker <https://bugs.python.org/issue33826> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue33826] enable discovery of class source code in IPython interactively defined classes

2018-10-29 Thread Thomas Viehmann
Change by Thomas Viehmann : -- stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue33826> ___ ___ Python-bugs-list

[issue33826] enable discovery of class source code in IPython interactively defined classes

2018-10-29 Thread Thomas Viehmann
Thomas Viehmann added the comment: Yeah, it's a shame no-one looked at the patch that seems to fix the underlying cause and now it's just a duplicate of a bug to improve error messages. On the up side, closing this bug will stop me from getting reminders about it. --

[issue33826] enable discovery of class source code in IPython interactively defined classes

2018-06-15 Thread Thomas Viehmann
Thomas Viehmann added the comment: So I want "inspect.showsource" to have the same output whether my class has been defined in a .py or in my Jupyter notebook. I appreciate there are limitations to what "inspect.showsource" can do, but I am not so sure how that cr

[issue33826] enable discovery of class source code in IPython interactively defined classes

2018-06-15 Thread Thomas Viehmann
Thomas Viehmann added the comment: Apologies for not being clear. So I wrote: In IPython (or Jupyter), `inspect.getsource` is able to retrieve the source code for functions but not classes. By this I mean: import inspect class X: pass inspect.getsource(X) Note that: - it won't wo

[issue33826] enable discovery of class source code in IPython interactively defined classes

2018-06-10 Thread Thomas Viehmann
New submission from Thomas Viehmann : Hello, thank you for Python! In IPython (or Jupyter), `inspect.getsource` is able to retrieve the source code for functions but not classes. The fundamental reason is that for functions, a "filename" (input reference rather) is available via f