[issue39391] Nondeterministic Pydoc output on functions that have functions as default parameters

2020-01-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Even if we change the repr of functions (I like this idea), this will not solve the general problem: many reprs contain an object id. In your case I suggest to post-process the pydoc output and replace parts matching ' at 0x[0-9a-fA-F]+'. --

[issue39391] Nondeterministic Pydoc output on functions that have functions as default parameters

2020-01-28 Thread Andrew Svetlov
Andrew Svetlov added the comment: Serhiy is right, I doubt if we can do something here. A function address is a part of its __repr__() output. -- nosy: +asvetlov ___ Python tracker

[issue39391] Nondeterministic Pydoc output on functions that have functions as default parameters

2020-01-27 Thread Peter O.
Peter O. added the comment: No, the use case I have in mind is storing outputs of the pydoc3 program -- as is -- in version control systems such as Git (e.g., running a command like "pydoc3 mymodule > mymodule_doc.txt"). The pydoc3 output is not further parsed by programs, or even

[issue39391] Nondeterministic Pydoc output on functions that have functions as default parameters

2020-01-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: You will get the same problem for common idiom of using a singleton for optional parameters without default value. _singleton = object() def get(key, default=_signleton): if default is _signleton: ... And for other objects whos

[issue39391] Nondeterministic Pydoc output on functions that have functions as default parameters

2020-01-24 Thread Ammar Askar
Ammar Askar added the comment: See also: https://bugs.python.org/issue37645 which discusses changing the string representation of functions to omit the address. -- nosy: +ammar2 ___ Python tracker

[issue39391] Nondeterministic Pydoc output on functions that have functions as default parameters

2020-01-19 Thread Peter Occil
New submission from Peter Occil : It appears that if a method has default parameters set to functions, as in this example: def f1(): pass def f2(a, b=f1): pass The resulting Pydoc output produces a different, nondeterministic rendering for the f2 method each time it