you shouldnt use "from sqlalchemy import *", even though its used in  
the docs for the sake of example, its generally looked down upon.   
there is also a "types" module in "from sqlalchemy import *" that can  
similarly interfere with python's "types" module.  or, you could also  
just "import logging" after the call to "from sqlalchemy import *"  
which will replace the sa logging module with the python one.

i think the usage of names that happen to be the same as python's  
names is in general an acceptible practice, since a lot of the names  
in python are pretty genertic (i.e. logging, types, compiler, test,  
locale, etc).  This is also why python 2.5 is leaning towards the new  
"absolute module imports" importing scheme which will be the default  
in 2.6.



On Oct 30, 2006, at 10:05 AM, Randall Smith wrote:

>
> In modules where I define tables, mappers and such I typically use:
>
>      from sqlalchemy import *
>
> I noticed in 0.3.0 there is a logging variable imported that can
> conflict with the Python logging module.  The symptom appeared when I
> ran some unit tests after upgrading SA and got the error:
>
>      log = logging.getLogger("my_project")
>      AttributeError: 'module' object has no attribute 'getLogger'
>
> I think either I should not use "from sqlalchemy import *" or nothing
> imported from sqlalchemy should overwrite Python keywords or standard
> module names.
>
> Randall
>
>
> >


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sqlalchemy
-~----------~----~----~----~------~----~------~--~---

Reply via email to