Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Preserve call arguments of generate_packet_map
The generate_packet_map function is using `functools.lru_cache` to preserve the results, however this decorator returns a `_lru_cache_wrapper` type, which only preserves the return type from the original function, without preserving call arguments (or overloads). This overrides `lru_cache` function during `TYPE_CHECKING`, and gives it a signature that preserves this information. This does however mean losing on the information that this function is cached, however for us, it's much more important to preserve call parameters and overloads so that calls to it are actually checked. So while this is absolutely a hack and it's not ideal, it's the lesser evil when the alternative is losing on the type info from all parameters.
- Loading branch information