weird code in Python interface

Поиск
Список
Период
Сортировка
От James Aspnes
Тема weird code in Python interface
Дата
Msg-id Pine.LNX.4.20.9912011239590.7701-100000@pine.cs.yale.edu
обсуждение исходный текст
Список pgsql-interfaces
Sorry to post this to the list but I'm not sure how to track down the
author.  In pg.py and pgsqldb.py in the Python interface (version
6.5.3 RPMs) the following lines of code appear:
  if not hasattr(self,e) and hasattr(self.db,e):     exec 'self.%s = self.db.%s' % ( e, e )

This would be safer, cleaner, and faster if rewritten as:
  if not hasattr(self,e) and hasattr(self.db,e):     setattr(self, e, getattr(self.db, e))

--Jim Aspnes <aspnes@cs.yale.edu>



В списке pgsql-interfaces по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [INTERFACES] Data Migration
Следующее
От: "Alexey V. Meledin"
Дата:
Сообщение: Perfomance