[issue23189] Set docstrings to empty string when optimizing with -OO.

2015-07-08 Thread Erik Bray
Erik Bray added the comment: 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 t

[issue23189] Set docstrings to empty string when optimizing with -OO.

2015-01-13 Thread Raymond Hettinger
Raymond Hettinger added the comment: > Here are some of the packages that run into trouble > when the docstrings are set to 'None' by the -OO optimization I think you should file bug reports for those packages. We've agreed here that the current behavior is correct and that the proposed change

[issue23189] Set docstrings to empty string when optimizing with -OO.

2015-01-12 Thread Jarle Selvåg
Jarle Selvåg added the comment: I agree that -OO does what (people have agreed) it's supposed to do. Many packages manipulates the docstring without checking for 'None' (see list below). For many package developers, it seems hard to remember that the docstrings may disappear after optimization

[issue23189] Set docstrings to empty string when optimizing with -OO.

2015-01-09 Thread Raymond Hettinger
Raymond Hettinger added the comment: It seems to me that the problem here lies with the packages that use __doc__+="sometext" rather than with -OO which is doing exactly what it is supposed to. -- nosy: +rhettinger ___ Python tracker

[issue23189] Set docstrings to empty string when optimizing with -OO.

2015-01-08 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: That's a backward compatibility break since existing code may be expecting None. At least it needs to be carefully considered, and should have no possibility of be applied to anything before Python 3.5. -- nosy: +barry versions: -Python 2.7, Python

[issue23189] Set docstrings to empty string when optimizing with -OO.

2015-01-08 Thread Jarle Selvåg
Jarle Selvåg added the comment: This issue is only relevant for classes that have this construct: class MyClass(object): __doc__ += '''Some more text''' -- ___ Python tracker _

[issue23189] Set docstrings to empty string when optimizing with -OO.

2015-01-08 Thread Jarle Selvåg
New submission from Jarle Selvåg: Python code byte-compiled with -OO has doc-strings stripped out. This creates problems when compiling different packages which changes the doc-strings by doing something like this: __doc__ += "additional text" (when the docstring is 'None', this will fail