mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 12:11:33 -06:00
Doc: match statement in style guide (#5187)
* Test: add micro benchmark for match * Doc: add 'match' to python style guide
This commit is contained in:
@@ -29,6 +29,10 @@
|
||||
* New classes, attributes, and methods in core code should have docstrings that follow
|
||||
[reST style](https://peps.python.org/pep-0287/).
|
||||
* Worlds that do not follow PEP8 should still have a consistent style across its files to make reading easier.
|
||||
* [Match statements](https://docs.python.org/3/tutorial/controlflow.html#tut-match)
|
||||
may be used instead of `if`-`elif` if they result in nicer code, or they actually use pattern matching.
|
||||
Beware of the performance: they are not `goto`s, but `if`-`elif` under the hood, and you may have less control. When
|
||||
in doubt, just don't use it.
|
||||
|
||||
## Markdown
|
||||
|
||||
|
Reference in New Issue
Block a user