typing
tcod_tutorial_v2
Our great sponsors
typing | tcod_tutorial_v2 | |
---|---|---|
38 | 8 | |
1,543 | 85 | |
1.6% | - | |
8.8 | 0.0 | |
7 days ago | 8 months ago | |
Python | Python | |
GNU General Public License v3.0 or later | Creative Commons Zero v1.0 Universal |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
typing
- Writing Python like it’s Rust
- Library for single dispatch on Generic subscript
-
Thoughts on nested / inner functions in Python for better encapsulation and clarity?
Iterable[str] is unfortunately evil as it matches str which is often unintended. (see: https://github.com/python/typing/issues/256) One would need both NOT-type and AND-type in order to properly handle these.
-
How to be more Literal in Python
The basic motivation behind them is that functions can have arguments that can only take a specific set of values, and those functions return values/types change based on that input. Common examples are (you can find more here):
-
Python 3.11.0b1 is out! Python 3.11 is now in feature freeze mode!
While yes 26 people liked the idea here: https://github.com/python/typing/issues/193
-
Type Hinting - Constrain metaclass of typing.Type
but looking at relevant issues on GitHub it seems this has been shot down repeatedly. python/typing#18, python/typing#213
-
What type hint should I use for "some container type" in general but explicitly exclude the str type?
See https://github.com/python/typing/issues/256 for a discussion.
-
Type annotations: how to express list contravariance?
Lower bounds are not supported for TypeVars, unfortunately.
-
I use attrs instead of pydantic
Mypy allows that because initial versions of PEP-484 allowed that. This has changed; here's the current wording on the PEP:
> This is no longer the recommended behavior. Type checkers should move towards requiring the optional type to be made explicit.
-
Can I walk through the entire hierarchy of object types?
Dunno, other, larger projects than the one I'm working on seem to run up against this from time to time. (rasa_core, to pick one example from near the top of a Google search; also Telethon, Blender, TensorFlow, Pandas. Guido also filed a bug on the typing module in an early version of Python 3.5 because of unexpected implications of this particular issue, so the problem isn't exactly purely theoretical.) That's aside from the wish for conceptual purity in the call signatures of classes and their subclasses, which is not always and automatically a bad wish to have; and the notion that a language that prides itself on its introspective faculties might want to make introspection of classes from the top of a class hierarchy possible, at least in theory? Perhaps to facility learning about the language and/or visualizing large class hierarchies easily, for instance?
tcod_tutorial_v2
-
Problems from Part 5 to Part 6 (Refactoring)
The map shouldn't be hidden by the changes. You can compare your sources with the expected part-6 sources here.
-
Python TCOD tutorial code backports
The old branches from 2020 don't work anymore. So I tried to get the changes from the new version and update the old part-13 (final) branch. You can find it in backports branch of my repo. This won't be merged with upstream, and here is the reason why.
- Help With a Python Attribute Error
-
Doing the tutorial and I'm stuck :(
engine is supposed to exist as engine.py in your projects working directory. See the part-3 example code for the correct layout. Something as simple as running main.py from a directory other its own will cause imports to not be found, so try running the sample code once.
-
Sharing Saturday #403
The engine itself had a few fixes which were planned for a 2021 tutorial which wasn't finished, those changes and panned ones are listed here and include things like a dedicated data directory, most modules being moved into a package, an updated color scheme, automated linting, and automated deployment of Win/Mac/Linux builds. Since then I didn't do much other than test a scene graph implementation that I've mentioned previously.
-
RoguelikeDev Does The Complete Roguelike Tutorial Starting June 29th 2021
I've made an issue to keep track of my current progress, and I'd also like suggestions on what people want updated in the tutorial.
-
Sharing Saturday #363
I finally remembered to add a license to the v2 Python tutorial. It is now in the public domain.
-
I've been putting off writing this for a while, but if someone can spare the time, i need help understanding some stuff from the libtcod python tutorial ( the "new" one made in python 3)
The latest tutorial with type-hinting is the "new" one, but this is if you wanted to follow the tutorial. To review the code itself you should look at the GitHub repository instead. This tutorial was written for Python 3.7.
What are some alternatives?
mypy - Optional static typing for Python
roguelike - A stealth roguelike in development phase.
pyre-check - Performant type-checking for python.
libtcod-vcpkg-template - A template for C++17 libtcod projects. This template uses Vcpkg to fetch dependencies.
fp-ts - Functional programming in TypeScript
fruit-economy
pydantic - Data validation using Python type hints
BrogueLite - This repository is deprecated. Please see Brogue Lite at the new repository.
Telethon - Pure Python 3 MTProto API Telegram client library, for bots too!
OneMoreLevel - A turn-based Roguelike game made with Godot engine.
mashumaro - Fast and well tested serialization library
RSRevived