Em Wednesday 07 November 2007 13:30:01 Christopher Arndt escreveu: > Christoph Zwerschke schrieb: > > One special case are the imports from sqlobject, sqlalchemy and elixir > > in model.py. In this case, importing * makes some sense. This had been > > changed recently for sqlalchemy, but with a very arbitrary list, so I > > changed this back to import * from sqlalchemy. I am not against > > importing explicitly, but then we should do it in all 3 cases and choose > > a reasonable list of names (see ticket #1604, options 2 or 3). > > In this case, I like option 2 (importing only the names used) better. > Otherwise we end up with huge sections of import statements at the start > of each file, which makes the code hard to scan. Admitted, it is > difficult to keep this list up-to-date (i.e. forgetting to remove unused > symbols form the import statement), but that's what pychecker is for IMHO. > > Maintaining readability is also the main arguments against "from foo > import *" IMO.
I believe that some tools also benefit from explicit imports instead of "import *". It makes their method resolution for completion while typing work better. It is also documentation for the code. One can never use something he / she doesn't know the origin. Be it our template model.py or the provider of the feature itself it is always good to make people know who to blame. :-) I vote for explicit imports even if we get too many things imported from ORMs (be it SA or SO or Elixir). Masking that will defeat part of the idea of making things clear to the user. -- Jorge Godoy <[EMAIL PROTECTED]> --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears Trunk" 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/turbogears-trunk?hl=en -~----------~----~----~----~------~----~------~--~---
