[issue33380] Update module attribute on namedtuple methods for introspection.

2018-05-01 Thread pmpp
pmpp added the comment: Indeed thanks for the deep explanation. It seems that not finding im_self anymore (not even in the dunder clutter), i've mistaken '.__self__.__module__' with '.__module__'. How joyfull to learn anew to trace a caller id, and sorry for the noise

[issue33380] Update module attribute on namedtuple methods for introspection.

2018-04-30 Thread Allan Feldman
Allan Feldman added the comment: That explanation makes sense to me. Thanks for taking the time to look into this! -- resolution: -> works for me stage: -> resolved status: open -> closed ___ Python tracker

[issue33380] Update module attribute on namedtuple methods for introspection.

2018-04-30 Thread Raymond Hettinger
Raymond Hettinger added the comment: ISTM collections is the correct module reference because that is where the code is actually defined. A debugging tool should look there instead of in the calling code. This is the way other tools work in Python as well:

[issue33380] Update module attribute on namedtuple methods for introspection.

2018-04-30 Thread pmpp
pmpp added the comment: I see that as a good fix, obviously Point definition belongs to __main__ in the sample, like would any other subclass defined there eg if "some" class is defined in awe.py module : >>> import awe >>> class my(awe.some):pass ... >>> my.__module__

[issue33380] Update module attribute on namedtuple methods for introspection.

2018-04-30 Thread Raymond Hettinger
Raymond Hettinger added the comment: Am not sure I can see any value in pushing the __module__ attribute down into the methods and think it is reasonable for them to report their origin as being in the collections module. --

[issue33380] Update module attribute on namedtuple methods for introspection.

2018-04-28 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- assignee: -> rhettinger nosy: +serhiy.storchaka ___ Python tracker ___

[issue33380] Update module attribute on namedtuple methods for introspection.

2018-04-28 Thread Allan Feldman
Allan Feldman added the comment: Attached is a proposed change. -- keywords: +patch Added file: https://bugs.python.org/file47555/0001-bpo-33380-Update-module-attribute-on-namedtuple-meth.patch ___ Python tracker

[issue33380] Update module attribute on namedtuple methods for introspection.

2018-04-28 Thread Allan Feldman
New submission from Allan Feldman : Python 3.7 made several performance improvements to the namedtuple class as part of https://bugs.python.org/issue28638 Prior to the implementation of bpo-28638, the __module__ attribute for a namedtuple's methods (e.g. _asdict)