[rb-general] Addresses in (I)Python output

Daniel Shahaf danielsh at apache.org
Wed Sep 25 19:10:27 UTC 2019


Chris Lamb wrote on Wed, Sep 25, 2019 at 12:14:24 +0100:
> Hi Rebecca,
> 
> > - jupyter-nbconvert may well be a suitable "documentation builds go 
> > through here, interactive use doesn't" place to disable address output 
> > by default (either by passing a "disable address output" command-line 
> > switch to IPython or by a search-and-replace on the output)
> 
> As a bit of background, from my hard-won experience in other areas of
> Reproducible Builds I would highly advise against adding a "disable
> address output" command- line argument that was *also* not enabled by
> default.
> 
> Otherwise you will end up in a Sisyphean situation where not only
> will you still need to patch the almost-countless number of existing
> software packages to enable said stripping, you will need to continually
> do this as new software is written.
> 

Even for documentation builds, removing addresses entirely could have
downsides.  For one, it would invalidate documentation that relies on
the hex addresses to demonstrate object identity.  Even CPython's own
FAQ does this:

	https://hg.python.org/cpython/file/4243df51fe43/Doc/faq/programming.rst#l1862

	The nature of the problem is made clear if you print out the "identity" of the
	class objects::
	
	   >>> hex(id(c.__class__))
	   '0x7352a0'
	   >>> hex(id(cls.C))
	   '0x4198d0'

Cheers,

Daniel


More information about the rb-general mailing list