Cast a value to a type. This returns the value unchanged. To the type checker this signals that the return value has the designated type, but at runtime we intentionally don't check anything (we want this to be as fast as possible).
(typ, val)
| 2367 | |
| 2368 | |
| 2369 | def cast(typ, val): |
| 2370 | """Cast a value to a type. |
| 2371 | |
| 2372 | This returns the value unchanged. To the type checker this |
| 2373 | signals that the return value has the designated type, but at |
| 2374 | runtime we intentionally don't check anything (we want this |
| 2375 | to be as fast as possible). |
| 2376 | """ |
| 2377 | return val |
| 2378 | |
| 2379 | |
| 2380 | def assert_type(val, typ, /): |
no outgoing calls
searching dependent graphs…