Re: [Python-Dev] (try-except) conditional expression similar to (if-else) conditional (PEP 308)

2009-08-14 Thread Alexander Kozlovsky
Jeff McAninch wrote: > I very often want something like a try-except conditional expression similar > to the if-else conditional. I think it may be done currently with the help of next function: def guard(func, *args): try: return func() except Exception, e:

Re: [Python-Dev] str.dedent

2005-11-13 Thread Alexander Kozlovsky
Raymond Hettinger wrote: > That is somewhat misleading. We already have that ability. What is > being proposed is moving existing code to a different namespace. So the > motivation is really something like: > >I want to write >s = s.dedent() >because it is too painful to write

[Python-Dev] Draft proposal: Implicit self in Python 3.0

2006-01-05 Thread Alexander Kozlovsky
Hello! I have some proposal for Python 3.0 (interesting one, from my point of view). I'm sorry for my English, it is not very good. Abstract There are three different peculiarity in Python 2.x in respect of 'self' method argument: 1. Each method must have explicit 'self' argument in i

Re: [Python-Dev] Draft proposal: Implicit self in Python 3.0

2006-01-05 Thread Alexander Kozlovsky
I wrote: > 5. Each function have two constant attributes, __class__ and __self__, >both of them have value 'None' Of course, this attributes have names 'im_class' and 'im_self', as before, but can be used with any function. I have not sleep enough last night :) Best regards, Alexander

Re: [Python-Dev] Draft proposal: Implicit self in Python 3.0

2006-01-06 Thread Alexander Kozlovsky
Hello! Ian Bicking wrote: > (As an aside directed at the original PEP, I think discussion of leaving > self out of expressions, e.g., ".x" for "self.x", should be separate > from the rest of this PEP). Yes, I'm fully agree. Nick Coghlan wrote: > The main concern I have is with the answer to th