-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
Closed as not planned
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory
Description
Bug report
Bug description:
def fn():
"""
>>> fn()
'\\u2009'
>>> fn() # this one shouldn't work
'\u2009'
"""
return '\u2009'
if __name__ == "__main__":
import doctest
doctest.testmod()
The second line is wrong because the character literal is not escaped. If you run help(fn)
you'll see this

but if you actually run the sample code you'd see
>>> fn()
'\u2009'
>>> fn()
'\u2009'
CPython versions tested on:
3.13
Operating systems tested on:
macOS
Metadata
Metadata
Assignees
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory