WMOkiishi / types-panda3d

Type stubs for the Panda3D Python bindings
MIT License
13 stars 0 forks source link

Add Python-level extension functions #4

Open Maxwell175 opened 1 year ago

Maxwell175 commented 1 year ago

I noticed that the various Python extension functions that are added to existing classes are not added.

https://github.com/panda3d/panda3d/tree/master/direct/src/extensions_native

WMOkiishi commented 1 year ago

The issue with those is that they don't exist if the extending module hasn't been imported, so including stubs for them could potentially be confusing. Most of them are deprecated anyway; do you use any of them in practice?

Maxwell175 commented 1 year ago

There are quite a few that are not deprecated. I regularly use the ones that pop up a small editor for specific nodes and intervals. I love NodePath.place, for example. There are even the interval short hands that are even referenced in the manual: https://docs.panda3d.org/1.10/python/programming/intervals/lerp-intervals#convenience-short-hands

WMOkiishi commented 1 year ago

Hmm... the fact that they don't always exist still makes me hesitant. It also seems like the ones you mentioned are mostly aliases for functions from other modules. Why wouldn't one, for example, just import place from direct.tkpanels.Placer? That being said, supporting the non-deprecated extension methods might be worthwhile, especially if they're mentioned in the docs.