Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 42
Closed
Labels
Description
Describe the bug
bsp.split_recursive raises a TypeError when the seed parameter receives a tcod.random.Random instance, even though the type hint allows tcod.random.Random | None.
To Reproduce
importtcodbsp=tcod.bsp.BSP(x=0, y=0, width=50, height=50) random=tcod.random.Random() bsp.split_recursive( depth=2, min_width=6, min_height=6, max_horizontal_ratio=1.5, max_vertical_ratio=1.5, seed=random, # raises TypeError )TypeError: initializer for ctype 'union TCOD_Random *' must be a cdata pointer, not Random However setting seed=random.random_c works fine. split_recursive could internally access .random_c for the type hint to hold.
Desktop (please complete the following information):
- OS: macOS 15.4.1
- Python version: 3.13.7
- tcod version: 19.5.0