Update PYTHON_API_CONVENTIONS.md

This commit is contained in:
Dor Shapira 2022-09-24 07:41:44 +03:00 committed by GitHub
parent c63f203578
commit d2485003d5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -8,7 +8,7 @@ Here is a list with some code conventions used by raylib in python:
| Local variables | lowerCase | ` playerPosition = Vector2(0, 0)` |
| Global variables | lowerCase | `windowReady = False` |
| Constants variables | lowerCase | `maxValue = 8` |
| Constants values | ALL_CAPS | `MAX_BUILDINGS = 5` |
| Constants values | ALL_CAPS | `MAX_BUILDINGS = 5`[^1] |
| string values | always "" | `output = "Hello"`, `"welcome"` |
| float values | always x.x | `gravity = 10.0` |
| Operators | value1 * value2 | `product = value * 6` |
@ -21,6 +21,7 @@ Here is a list with some code conventions used by raylib in python:
| Functions | lowerCase & wordSeparationBy_ | `init_window()`, `window_should_close()` |
| Functions params | lowerCase | `width`, `height` |
| Ternary Operator | result1 if (condition) else result2 | `print("yes" if (value == 0) else "no")` |
[^1]: like `macro definitions` of value in C
Some other conventions to follow:
- **ALWAYS** initialize all defined variables.