"help( pi )"

Cameron Simpson cs at cskk.id.au
Mon Nov 20 17:10:31 EST 2017


On 20Nov2017 10:49, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:
>Cameron Simpson wrote:
>>Unless one had a misfortune and wanted another docstring.
>
>Good point. I guess having differing docstrings should make
>otherwise equal objects ineligible for merging.
>
[...example...]
>
>I think setting the docstring of an existing immutable object
>would have to be disallowed -- you need to create a new object
>if you want it to have a distinct docstring, e.g.
>
>MAX_BUFSIZE = int(8192, __doc__ = 'Size of the hardware buffer used 
>for I/O on this device.')

Which is painful and elaborate. In my original post I had written:

  Now, I accept that the "CPython coaleases some values to shared singletons" 
  thing is an issue, but the language doesn't require it, and one could change 
  implementations such that applying a docstring to an object _removed_ it from 
  the magic-shared-singleton pool, avoiding conflicts with other uses of the 
  same value by coincidence.

hoping for automatic arrangement of that.

Cheers,
Cameron Simpson <cs at cskk.id.au> (formerly cs at zip.com.au)



More information about the Python-list mailing list