[New-bugs-announce] [issue39391] Nondeterministic Pydoc output on functions that have functions as default parameters

Peter Occil report at bugs.python.org
Sun Jan 19 18:03:57 EST 2020


New submission from Peter Occil <poccil14 at gmail.com>:

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 generates the documentation, such as `m1(a, b=<function f1 at 0x7f4ff67f8950>)` or `m1(a, b=<function f1 at 0x7f4ff67f8950>)`.  And this is problematic for version control systems, among other things, especially since this is not a meaningful change to the documentation.

One solution may be to write, say, `m1(a, b=f1)` instead.

----------
assignee: docs at python
components: Documentation
messages: 360278
nosy: Peter Occil, docs at python
priority: normal
severity: normal
status: open
title: Nondeterministic Pydoc output on functions that have functions as default parameters
type: behavior

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39391>
_______________________________________


More information about the New-bugs-announce mailing list