This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author erik.bray
Recipients barry, erik.bray, jvs, rhettinger
Date 2015-07-08.20:12:31
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1436386352.06.0.171837159615.issue23189@psf.upfronthosting.co.za>
In-reply-to
Content
For what it's worth (since it was mentioned toward the end of this thread as an offending package) Astropy has a patch now to fix its misbehavior with respect to this issue.

I do feel like this would be nice to fix though, since I think it's awkward to have code that on its face clearly has a docstring, but still have to check that the docstring may be None.  Just to put it out there if anyone were really interested, I identified two ways this could be changed:

1) For functions add a new co_flags flag indicating that docstrings were optimized out.  This is at the cost of a co_flags flag.

2) Keep an empty string as the first element in co_consts, at the const of one additional constant per function that previously had a docstring (still cheaper than the docstring itself in most cases).

Of course, it would still break backward compatibility for code that expects None for an optimized out docstring, I guess, and probably isn't worth either of the above two sacrifices at the end of the day.
History
Date User Action Args
2015-07-08 20:12:32erik.braysetrecipients: + erik.bray, barry, rhettinger, jvs
2015-07-08 20:12:32erik.braysetmessageid: <1436386352.06.0.171837159615.issue23189@psf.upfronthosting.co.za>
2015-07-08 20:12:32erik.braylinkissue23189 messages
2015-07-08 20:12:31erik.braycreate