Description of the task
Using wildcard imports are bad practice in Python because:
- They add a lot of unnecessary classes and functions to the global namespace
- They don't work well with any Python LSPs
- It allows conflicting identifier names. For example, in
simulated_hrvo_test.py, THE ORDER OF IMPORTS MATTERS. If you move from proto.ssl_gc_common_pb2 import Team above from proto.import_all_protos import *, the code will break since they import two different Team types. (This is also why a lot of places in the code uses from proto.ssl_gc_common_pb2 import Team as SslTeam)
A better practice is to either import as a module: import proto.import_all_protos as proto or explicitly importing specific identifiers: from proto.import_all_protos import Ball, Team. Both have their pros and cons and both types of imports currently exist in the codebase already.
Acceptance criteria
Blocked By
N/A
Description of the task
Using wildcard imports are bad practice in Python because:
simulated_hrvo_test.py, THE ORDER OF IMPORTS MATTERS. If you movefrom proto.ssl_gc_common_pb2 import Teamabovefrom proto.import_all_protos import *, the code will break since they import two different Team types. (This is also why a lot of places in the code usesfrom proto.ssl_gc_common_pb2 import Team as SslTeam)A better practice is to either import as a module:
import proto.import_all_protos as protoor explicitly importing specific identifiers:from proto.import_all_protos import Ball, Team. Both have their pros and cons and both types of imports currently exist in the codebase already.Acceptance criteria
Blocked By
N/A