[sqlalchemy] Re: any particular reason for creating unused lists?

2007-02-04 Thread Michael Bayer
OK, i added this in 2298. I dont notice any speed enhancement in overall performance of the unit tests even though it builds on set and not sets.Set...this is probably because we dont use OrderedSet too much. Also i had to make some changes so its compatible with 2.3 (no generator expressions,

[sqlalchemy] Re: any particular reason for creating unused lists?

2007-02-03 Thread Michael Bayer
On Jan 31, 1:28 pm, svilen [EMAIL PROTECTED] wrote: another things i noted: - using value.lower() == value instead of value.islower() ha x = 27 x.islower() False x.lower() == x True breaks a lot of tests too --~--~-~--~~~---~--~~ You received this

[sqlalchemy] Re: any particular reason for creating unused lists?

2007-02-03 Thread sdobrev
- using value.lower() == value instead of value.islower() ha x = 27 x.islower() False x.lower() == x True breaks a lot of tests too okay, forget that. Here an example OrderedSet over set; that seems to give a bigger speedup than anything else, and without touching anything.

[sqlalchemy] Re: any particular reason for creating unused lists?

2007-01-31 Thread svilen
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() ) )

[sqlalchemy] Re: any particular reason for creating unused lists?

2007-01-31 Thread Michael Bayer
On Jan 31, 1:28 pm, svilen [EMAIL PROTECTED] wrote: 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

[sqlalchemy] Re: any particular reason for creating unused lists?

2007-01-31 Thread sdobrev
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*' ',

[sqlalchemy] Re: any particular reason for creating unused lists?

2007-01-25 Thread Jonathan Ellis
Reasonable people can differ here, but I agree that if what you care about is a side effect, rather than a resulting list, using a for loop is more clear than a list comprehension. (I suspect it is also more performant since you are not allocating and populating a list object for no reason.)

[sqlalchemy] Re: any particular reason for creating unused lists?

2007-01-25 Thread Michael Bayer
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, [EMAIL PROTECTED] wrote: there are