Thankyou everyone for the feedback. 

After the interesting discussion, and Thomas' encouragement in
particular, I'll work on this. It may be a week or two before I have any
results to show (I'm anticipating a particularly busy week, so OCC work
is confined to my spare time).

Regarding the question of python lazy imports and naming conflicts, I am
sure conflicts would occur. For example:

        gp_Circle vs. Geom_Circle

However, I understand that it is standard python practice to avoid lazy
imports (I certainly do) except in limited circumstances such as an
interactive terminal session. Really, we are removing the need for lazy
imports: the correct and simplest way to distinguish the two Circle
classes is by their package prefix i.e. gp.Circle() vs Geom.Circle(). We
should certainly make this clear in the docs for the benefit of new
python users. I expect experienced python programmers will follow best
practice by default. You also gain a little more flexibility this way,
since python allows you to rename modules on import i.e.
        
        from OCC import gp, Geom as G
        c1 = gp.Circle()
        c2 = G.Circle()

Raising a warning or exception to prevent import * seems slightly
draconian, although this wouldn't inconvenience me personally.

cheers,

Bryan C




_______________________________________________
Pythonocc-users mailing list
Pythonocc-users@gna.org
https://mail.gna.org/listinfo/pythonocc-users

Reply via email to