pyomo
pyomo copied to clipboard
add type hints to components
Changes proposed in this PR:
- Add some type hints to components
Legal Acknowledgement
By contributing to this software project, I have read the contribution guide and agree to the following terms and conditions for my contribution:
- I agree my contributions are submitted under the BSD license.
- I represent I am authorized to make the contributions and grant the license. If my employer has rights to intellectual property that includes these contributions, I represent that I have received permission to make contributions and grant the required license on behalf of that employer.
It looks like there might be a workaround to avoid the function call:
@overload
def __getitem__(self, index) -> _BlockData:
...
__getitem__ = IndexedComponent.__getitem__ # type: ignore
It looks like there might be a workaround to avoid the function call:
@overload def __getitem__(self, index) -> _BlockData: ... __getitem__ = IndexedComponent.__getitem__ # type: ignore
Genius!!!