[New-bugs-announce] [issue39354] collections.UserString format and format_map return a string

bizywizy report at bugs.python.org
Thu Jan 16 04:18:53 EST 2020


New submission from bizywizy <bizywiz at gmail.com>:

collections.UserString.format and collections.UserString.format_map return a string instaed of UserString.

This is quite weird because I expect that the %-syntax and `format` method have to produce the same result.

```
>>> isinstance(UserString('Hello %s') % 'World', UserString)
True
>>> isinstance(UserString('Hello {}').format('World'), UserString)
False
```

----------
components: Library (Lib)
messages: 360101
nosy: bizywizy
priority: normal
severity: normal
status: open
title: collections.UserString format and format_map return a string
type: behavior
versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9

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


More information about the New-bugs-announce mailing list