11 messages in com.googlegroups.sqlalchemy[sqlalchemy] Re: any particular reaso...
FromSent OnAttachments
sdob...@sistechnology.com25 Jan 2007 13:29 
Jonathan Ellis25 Jan 2007 13:58 
Michael Bayer25 Jan 2007 14:03 
svilen30 Jan 2007 01:34 
svilen31 Jan 2007 10:28 
Michael Bayer31 Jan 2007 11:21 
sdob...@sistechnology.com31 Jan 2007 17:19 
Michael Bayer03 Feb 2007 17:20 
sdob...@sistechnology.com04 Feb 2007 00:42.bz2
Michael Bayer04 Feb 2007 13:16 
svilen05 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)