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-11 12:18:58 +00:00
2019-10-13 21:51:43 +02:00
2019-10-01 05:31:34 -07:00
2019-10-10 12:24:44 +02:00
2019-10-08 07:59:32 -07:00
2019-10-15 14:42:25 +02:00
2019-10-30 23:21:50 +01:00
2019-10-29 19:53:47 -07:00
2019-10-08 07:59:32 -07:00
2019-11-23 16:12:45 +01:00
2019-11-10 19:30:12 +01:00
2019-10-14 09:53:48 +02:00
2019-11-04 08:10:45 -08:00
2019-11-24 12:51:33 +01:00
2019-11-13 20:09:30 +01:00
2019-04-13 10:40:52 +02:00
2018-03-05 12:42:29 -08:00
2019-10-08 07:59:32 -07:00
2019-10-08 07:59:32 -07:00
2019-04-13 10:40:52 +02:00
2018-07-21 23:37:21 -07:00
2019-10-08 07:59:32 -07:00
2017-03-14 11:43:42 -07:00
2019-04-13 10:40:52 +02:00
2019-10-28 06:59:28 -07:00
2019-10-20 10:37:33 +02:00
2019-10-13 16:22:03 -07:00
2019-10-13 21:51:43 +02:00
2019-10-01 05:31:34 -07:00
2019-08-10 13:08:18 -07:00
2018-07-02 20:23:29 -07:00
2019-10-16 12:39:56 -07:00
2016-09-23 13:35:55 -07:00
2019-11-23 07:20:54 -08:00
2019-10-09 10:27:18 -07:00
2019-10-29 19:52:05 -07:00
2019-10-09 10:27:18 -07:00
2019-07-27 10:58:21 +02:00
2019-04-13 10:40:52 +02:00
2015-09-30 09:59:44 -07:00
2019-11-06 07:21:32 -08:00
2019-10-12 19:36:56 +02:00
2019-04-13 10:40:52 +02:00
2018-06-28 10:29:45 -07:00
2019-10-12 19:36:56 +02:00
2019-07-27 10:58:21 +02:00
2019-10-12 19:36:56 +02:00
2019-04-13 10:40:52 +02:00
2019-10-08 07:59:32 -07:00
2019-11-20 10:29:05 +00:00
2019-10-20 10:37:33 +02:00
2019-11-24 00:08:53 +01:00
2019-10-09 19:28:42 -07:00
2019-04-30 14:53:59 -07:00
2019-07-27 10:58:21 +02:00
2019-10-08 07:59:32 -07:00
2019-10-20 10:37:33 +02:00
2017-04-30 14:16:30 -07:00
2019-10-14 09:53:48 +02:00
2018-07-02 20:23:29 -07:00
2019-10-20 10:37:33 +02:00
2019-10-20 10:37:33 +02:00
2019-10-01 05:31:34 -07:00
2019-10-01 05:31:34 -07:00
2019-08-05 08:08:57 -07:00
2019-10-01 05:31:34 -07:00
2019-10-20 10:37:33 +02:00
2018-08-18 19:25:48 -07:00
2019-10-20 10:37:33 +02:00
2019-10-01 05:31:34 -07:00
2019-10-28 06:59:28 -07:00
2019-10-13 21:51:43 +02:00
2019-10-12 19:15:44 +02:00
2019-08-16 16:13:33 -07:00
2019-10-20 10:37:33 +02:00
2019-04-13 10:40:52 +02:00
2019-10-28 08:08:49 +01:00
2019-10-14 09:53:48 +02:00
2019-10-14 09:53:48 +02:00
2019-11-24 18:16:48 -08:00
2019-10-28 06:59:28 -07:00
2019-07-27 10:58:21 +02:00
2019-11-11 13:22:28 -08:00
2019-10-01 05:31:34 -07:00
2017-10-08 21:12:19 -07:00
2019-11-23 20:17:14 +01:00
2019-04-13 10:40:52 +02:00
2019-10-14 09:53:48 +02:00
2019-10-28 06:59:28 -07:00
2019-07-27 10:58:21 +02:00