Files
typeshed/stdlib/3
Mohammed El-Afifi c76a298ffa Fix type hints in Template class (#3491)
Nothing in the standard library documentation for the string module suggests that the value associated with any key in the mapping parameter(or kwds) to Template.substitute and Template.safe_substitute should be a string. In fact any object can be used, for example

Template("$number is a number.").substitute({"number": 1})

The above code sample currently causes an error message like this:

error: Dict entry 0 has incompatible type "str": "int"; expected "str": "str"

which obviously shouldn't be emitted. Also a similar logic is already in place for methods in the Formatter class. However as I saw the notice about loose types above the Formatter class, I opted to use `object` instead of `Any` as the implementation inside the affected functions just uses the built-in str function on values inside mappings.
2019-11-24 18:16:48 -08:00
..
2019-11-13 20:09:30 +01:00
2019-10-29 19:52:05 -07:00
2019-07-27 10:58:21 +02:00
2019-11-20 10:29:05 +00:00
2019-07-27 10:58:21 +02:00
2017-04-30 14:16:30 -07:00
2019-08-05 08:08:57 -07:00
2018-08-18 19:25:48 -07:00
2019-07-27 10:58:21 +02:00
2017-10-08 21:12:19 -07:00
2019-11-23 20:17:14 +01:00
2019-07-27 10:58:21 +02:00