11 messages in com.googlegroups.sqlalchemy[sqlalchemy] Re: any particular reaso...| From | Sent On | Attachments |
|---|---|---|
| sdob...@sistechnology.com | 25 Jan 2007 13:29 | |
| Jonathan Ellis | 25 Jan 2007 13:58 | |
| Michael Bayer | 25 Jan 2007 14:03 | |
| svilen | 30 Jan 2007 01:34 | |
| svilen | 31 Jan 2007 10:28 | |
| Michael Bayer | 31 Jan 2007 11:21 | |
| sdob...@sistechnology.com | 31 Jan 2007 17:19 | |
| Michael Bayer | 03 Feb 2007 17:20 | |
| sdob...@sistechnology.com | 04 Feb 2007 00:42 | .bz2 |
| Michael Bayer | 04 Feb 2007 13:16 | |
| svilen | 05 Feb 2007 01:20 |
| Subject: | [sqlalchemy] Re: any particular reason for creating unused lists?![]() |
|---|---|
| From: | svilen (sdob...@sistechnology.com) |
| Date: | 01/31/2007 10:28:26 AM |
| List: | com.googlegroups.sqlalchemy |
another things i noted: - using "value.lower() == value" instead of value.islower()
- ansisql.py: in _requires_quotes(): this " bool(len([x for x in str(value) if x not in self._legal_characters()])) " should be same as bool( s.translate( 256*' ', self._legal_characters() ) ) and that table(256) can be a static/global.
i know, speed will not budge... well, profiling some case (5x (simple A,B,C setup + 50x query)), 6% goes in visit_select, 3% of time goes in __generic_obj_format(), and 3% in getattr, and everything else gets less.
just habit ...i dont like one liners with ":", also makes it easy to tack on conditionals...feel free to submit a patch for all those if theyre really bothering you (i guarantee program speed /mem usage will not budge in any measurable way).
On Jan 25, 4:30 pm, sdob...@sistechnology.com wrote:
there are several places of such unused lists being made.
i pick a random occurence, in this case InstrumentedAttribute:
def _adapt_list(self, data): if self.typecallable is not None: t = self.typecallable() if data is not None: [t.append(x) for x in data] return t else: return data
why not just for x in data: t.append(x)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to sqla...@googlegroups.com
To unsubscribe from this group, send email to
sqla...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---





.bz2