Why are modules generated from C++ prefixed with "Py"? #283
Replies: 4 comments 12 replies
-
Mostly ignorance, but then to differentiate between the “Ac” prefix. I think the first class I wrote was wrapper around When programming in Arx, I think of Having spent time programming in .NET and having to use obnoxiously long spaces i.e Even typing Having said that, I considered |
Beta Was this translation helpful? Give feedback.
-
More background; I had never written a line of Python in my life before starting this project. My goal was only to make a better scripting interface for AutoCAD. Originally, I had started extending AutoLISP, but then I found a breaking bug in AutoCAD’s OARX <-> AutoLISP interface that made this impossible. I had been watching a previous attempt from MickD at the swamp to embed Python into ARX, codenamed PyArx. Python fit the bill perfectly, I could interface with it directly, unlike lisp, it had deterministic garbage collection, unlike .NET. The next issue was scale. I had posted a link to PyAcad (another Py prefix) https://pyacad.sourceforge.net/ for Mick to check out, he had been considering SWIG. I had played with the results of SWIG from ODA https://www.opendesign.com/files/white-papers/ODA%20SWIG%20Wrappers.pdf it was clear that in order for the project to be “Juicy and Delicious”, it had to be hand rolled with love. I hand rolled a prototype with PyAcad, but it quickly became clear that I could not finish the task in my lifetime The choices at that point we PyBind11 (Again with the Py) and boost::python, after a bit more prototyping, boost was my choice as it was x4 faster. By the time anyone with actual Python experience took interest, I was already 150,000 lines of code in. The first stub generator was a monumental catastrophe, Grzegorz has been cleaning up ever since. |
Beta Was this translation helpful? Give feedback.
-
I don’t have a problem dropping the Py. It’s a bit of a chore, mostly just a lot of find and replace. The C++ classes internally will still need to be prefixed with Py |
Beta Was this translation helpful? Give feedback.
-
I think this branch (Task285) is now too far out of date, I messed you up by adding in ton of signatures; we will get into merge hell. I also forgot to do the return types. I propose to delete it and get it done in main when we’re ready to knock it out |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I was wondering what is the motivation for prefixing the Python modules generated from C++ with
Py
? (PyDb
,PyAx
...)The first thing that is done when loading those modules from Python is giving them an alias without this prefix.
Why not directly generating the Python module directly with their final name?
It would:
pyrx.doc_utils.rx_meta.PyRxModule
would not be needed anymoreimport PyModule as Module
toimport Module
Beta Was this translation helpful? Give feedback.
All reactions