Re: map/filter/reduce/lambda opinions and background unscientific mini-survey

2005-07-06 Thread Stian Søiland
uot; might be that it sounds like you can replace "else if" with "else x=94" if you want. Thumbs up for "else if" because it explains what it is much better than "elif". "elseif" ? -- Stian Søiland Work toward win-win situation. Wi

Re: map/filter/reduce/lambda opinions and background unscientific mini-survey

2005-07-06 Thread Stian Søiland
.ImmutableArrayList.fromCollection(L.getAbstractCollection()) python.util.functional.applyFunctionOnCollection( (class implements python.util.functional.AnonymousFunction: def anonymousFunction(x): return x+1 ), L) -- Stian Søiland Work toward

Re: Use cases for del

2005-07-06 Thread Stian Søiland
2. Please. -- Stian Søiland Work toward win-win situation. Win-lose Trondheim, Norway is where you win and the other lose. http://soiland.no/ Lose-lose and lose-win are left as an exercise to the reader. [Limoncelli/Hogan] -- http://mail

Re: map/filter/reduce/lambda opinions and background unscientific mini-survey

2005-07-06 Thread Stian Søiland
#python each day.. "How do I check if a variable is set?". Why do you want to check if a variable is set at all? If you have so many places the variable could or could not be set, your program design is basically flawed and must be refactored. -- Stian Søiland Work toward

Re: map/filter/reduce/lambda opinions and background unscientificmini-survey

2005-07-06 Thread Stian Søiland
cuiting of and-or and even occasionally have used such masturbation techniques as this, I don't think it qualifies as pythonic. If it was me, I would probably even have written: [x and math.sin(x)/x or 1 for x in myList] -- Stian Søiland Work toward win-win situation. Win-lose Trond

Re: flatten(), [was Re: map/filter/reduce/lambda opinions ...]

2005-07-06 Thread Stian Søiland
ionallity of Python. Using yield_return could also make it more obvious that the result is in fact a generator in functions that wrap generators. -- Stian Søiland Work toward win-win situation. Win-lose Trondheim, Norway is where you win and the other lose. http://soiland.no/

Re: built-in 'property'

2004-12-28 Thread Stian Søiland
n implement the wrapping your self in NOTOK like this: class NOTOK(object): def __getattribute__(self, key): obj = object.__getattribute__(key) if hasattr(obj, "__get__"): return obj.__get__() return obj # And similar for __setattr__ a

Re: objects as mutable dictionary keys

2004-12-29 Thread Stian Søiland
something_else This will break the object.__hash__ shown above.. What about checking if __hash__ has been overridden as well, and if so, always return id()? -- Stian Søiland Work toward win-win situation. Win-lose Trondheim, Norway is where y