brettviren / moo

ruminants on module oriented programming
GNU General Public License v3.0
4 stars 4 forks source link

Possible name conflict with moo.otypes #36

Open brettviren opened 2 years ago

brettviren commented 2 years ago

The moo.otypes module will construct types from schema. A type is constructed in the moo.otypes module namespace and then a Python module path is constructed/imported matching the schema path and the type is added there.

Phil reports some name collision when moo.otypes.load_types() is called in user code which also does an from ... import ConflictingName where that name is also used in a loaded-from-schema type. This imported type seems to replace the moo.otypes.ConflictingName despite this name not obviously existing nor referenced.

A work around is to do like from ... import ConflictingName as UniqueName but this should not be required.

Why this happens is not clear as nothing in moo.otypes "should" be populating the user module namespace.