botbowl icon indicating copy to clipboard operation
botbowl copied to clipboard

Add type annotations for functions (PEP 484)

Open mrbermell opened this issue 3 years ago • 4 comments

PEP 484 specifies a syntax for providing type hints for function arguments and return types:

def greeting(name: str) -> str:
    return 'Hello ' + name

This makes the code more readable and gives more information to linters which can point out inconsistencies.

It would be great to have for all python files in the framework, especially the ones used for bot development. This is a great way to get started working with and understanding the framework. Any help is greatly appreciated!

TODO:

  • [x] core/game.py
  • [x] core/model.py
  • [ ] core/procedure.py
  • [x] core/forward_model.py
  • [ ] core/load.py
  • [ ] core/table.py
  • [ ] core/util.py
  • [ ] ai/env.py
  • [ ] ai/pathfinding.py
  • [ ] ai/registry.py

mrbermell avatar Oct 25 '21 10:10 mrbermell

Please assign this issue to me, I am working on basic annotation and should hopefully have a PR up soon for you to review.

phasenoisepon avatar Oct 26 '21 07:10 phasenoisepon

@phasenoisepon, great that you've taken on this! Do you need any help or do you have any questions? =)

mrbermell avatar Nov 01 '21 09:11 mrbermell

Haven't had a lot of time to work on this, feel free to assign it to someone else.

phasenoisepon avatar Nov 02 '21 23:11 phasenoisepon

Ok, no worries!

mrbermell avatar Nov 03 '21 06:11 mrbermell