Repository navigation
Commit 4e08def
Use
Unfortunately Python's type checking doesn't currently support functions with
attributes (python/mypy#2087) and it fails with a
message like `No attribute 'timestamp' on Callable[[Any], Any] [attribute-error]`.
This change adds a `Protocol` to the unit test such that the function can be
recognized as having the required attributes.
PiperOrigin-RevId: 477439369Protocol instead of Callable in rate_limit_wrapper_test.1 parent e5b2c1c commit 4e08def
1 file changed
Lines changed: 16 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
49 | 61 | | |
50 | 62 | | |
51 | 63 | | |
| |||
107 | 119 | | |
108 | 120 | | |
109 | 121 | | |
| 122 | + | |
110 | 123 | | |
111 | 124 | | |
112 | 125 | | |
| |||
145 | 158 | | |
146 | 159 | | |
147 | 160 | | |
| 161 | + | |
148 | 162 | | |
149 | 163 | | |
150 | 164 | | |
| |||
185 | 199 | | |
186 | 200 | | |
187 | 201 | | |
| 202 | + | |
188 | 203 | | |
189 | 204 | | |
190 | 205 | | |
191 | 206 | | |
192 | 207 | | |
193 | 208 | | |
| 209 | + | |
194 | 210 | | |
195 | 211 | | |
196 | 212 | | |
| |||
0 commit comments