Hi Bryan, I like your suggestion. It makes the code more compact (which seems like a pythonic kind of idea) and less redundant. I think it makes code more readable too. The only drawback I see is that it departs pythonOCC code further from straight C++. I don't think this as such a big issue, but maybe I would change my mind if I was porting from pythonOCC to OCC.
I have no idea about how difficult this is to do with SWIG. If you know how to do it, that's cool. Arthur Bryan Cole wrote: > Hi All, > > I'm not sure if this has been debated previously, but I would very much > like the pythonOCC wrappers to rename OCC class so as to remove the > package prefix from the name. > > I am not fond of the lazy import syntax i.e. > > from OCC.BRep import * > blah = BRep_Builder(...) > > One problem with this is the name-space pollution hinders things like > IDE auto_completion (you get too many options). This makes coding with > OCC just little less pleasant than it could be. > > I usually use > > from OCC import BRep > blah = BRep.BRep_Builder(...) > > but the IDE auto-completion is still hindered, since everything in BRep > begins with the same prefix, and it's somewhat more typing. > > I'd much prefer: > > from OCC import BRep > blah = BRep.Builder(...) > etc. > > I think it should be possible to mod the SWIG_generator script to > include a %rename directive for each class, to achieve this. > > Obviously, this would break all existing code, but I think long-term it > is worth it. If this is to happen at all, it needs to happen ASAP. > > I'm will attempt to produce a patch for this myself and fix up as many > of the examples as I can, but if the consensus is against the change, > then I won't pursue this any further. > > What do you all think? > > Bryan C > > > > _______________________________________________ > Pythonocc-users mailing list > Pythonocc-users@gna.org > https://mail.gna.org/listinfo/pythonocc-users -- Arthur Magill, PhD RF Engineer Centre d'Imagerie BioMédicale (CIBM) Laboratory for Functional and Metabolic Imaging (LIFMET) Ecole Polytechnique Fédérale de Lausanne (EPFL) Station 6, CH F1 532 (Bâtiment CH), CH-1015 Lausanne, Switzerland tel: +41 21 693 0569 fax: +41 21 693 7960 email: arthur.mag...@epfl.ch _______________________________________________ Pythonocc-users mailing list Pythonocc-users@gna.org https://mail.gna.org/listinfo/pythonocc-users