[New-bugs-announce] [issue25548] Show the address in the repr for class objects

Raymond Hettinger report at bugs.python.org
Tue Nov 3 13:40:11 EST 2015


New submission from Raymond Hettinger:

In old-style classes, the memory address of the class object is shown for both the class and for the instance.  In new-style classes, only the instance shows the address.  I and other Python instructors have found the memory address display to be useful and I think it should be added back:

Old-style
=========
 
  >>> class A:
  	pass

  >>> a = A()
  >>> A
  <class __main__.A at 0x10061e328>
  >>> a
  <__main__.A instance at 0x105292cb0> 


New-style
=========

  >>> class A(object):
  	pass

  >>> a = A()
  >>> A
  <class '__main__.A'>
  >>> a
  <__main__.A object at 0x105332cd0>

----------
messages: 254012
nosy: rhettinger
priority: normal
severity: normal
status: open
title: Show the address in the repr for class objects
type: enhancement
versions: Python 3.6

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue25548>
_______________________________________


More information about the New-bugs-announce mailing list