New submission from Serhiy Storchaka:

Often when class name is reported in stdlib (e.g. in reprs), it used together 
with module name: '%s.%s' % (self.__class__.__module__, 
self.__class__.__name__). But this code is wrong when a class is nested. The 
__qualname__ attribute should be used instead of just __name__ (and it is 
already used in multiple places).

Proposed patch replaces __name__ to __qualname__ when it used together with 
module name to format full class name.

----------
components: Library (Lib)
files: repr_qualname.diff
keywords: patch
messages: 223649
nosy: serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Use __qualname__ together with __module__
type: behavior
versions: Python 3.4, Python 3.5
Added file: http://bugs.python.org/file36026/repr_qualname.diff

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue22032>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to