@NullTheFool@mastodon.gamedev.place
Post #3887860
2026-07-17 15:05 UTC
Question for Python people.
Do type annotations improve performance in Python like they do in GDScript, or are they just there to make code more explicit? Do people use them a lot?
Replies (3)
-
@0x00string@infosec.exchange 2026-07-17 15:10
@NullTheFool@mastodon.gamedev.place i dont think they get used when its executed, and when ive seen them its felt really pedantic
-
@lethalbit@chaos.social 2026-07-17 15:08
@NullTheFool@mastodon.gamedev.place As far as I know, there is no performance improvement, as they are basically discarded by the interpreter
-
@Ronflaix@mastodon.gamedev.place 2026-07-17 15:12
@NullTheFool@mastodon.gamedev.place it changed nothing except providing to linters , programmers and debuggers a hint about what the type is expected to be. Given Python's core duck typing principle, you can still pass anything other than the type you provided, it'll just cause a few warnings but no performance or codegen change