robotpy / pyfrc

python3 library designed to make developing RobotPy-based code easier!
MIT License
50 stars 35 forks source link

PhysicsEngine should be a Protocol for type checking #210

Open auscompgeek opened 1 year ago

auscompgeek commented 1 year ago

https://github.com/robotpy/pyfrc/blob/9959bff71165ea74d1df018c1fb496bcb2aeafe8/pyfrc/physics/core.py#L50

https://docs.python.org/3/library/typing.html#typing.Protocol

TheTripleV commented 1 year ago

Says it was added in 3.8. Is it in future?

virtuald commented 1 year ago

In the past I've just done something like this:

try:
    from typing import Protocol
except ImportError:
    Protocol = object
auscompgeek commented 1 year ago

It should also be in typing_extensions.