[Python-3000] A new member for contextlib?

2008-04-04 Thread Zaur Shibzoukhov
I suggest a context manager for property defining/redefining. There is a prototype and illustrative example: -- import sys null = object() _property = property class property(_property):

Re: [Python-3000] A new member for contextlib?

2008-04-04 Thread Benjamin Peterson
On Fri, Apr 4, 2008 at 2:49 AM, Zaur Shibzoukhov <[EMAIL PROTECTED]> wrote: > I suggest a context manager for property defining/redefining. There is a > prototype and illustrative example: > > > >

Re: [Python-3000] A new member for contextlib?

2008-04-04 Thread Christian Heimes
Zaur Shibzoukhov schrieb: > I suggest a context manager for property defining/redefining. There is a > prototype and illustrative example: Python 2.6 and 3.0 already have a new way to modify properties: class C(object): @property def x(self): return self._x @x.setter def x(self, v

[Python-3000] A new member for contextlib?

2008-04-04 Thread Zaur Shibzoukhov
Benjamin Peterson: > I don't really see how this is better/easier than: > class AAA: > def get_x(): pass > def set_x(): pass > x = property(get_x, set_x, None, "The x property") Perhaps it's better because :) @classmethod def func(self): pass is better than def func(self): pass func

Re: [Python-3000] A new member for contextlib?

2008-04-04 Thread Paul Moore
On 04/04/2008, Zaur Shibzoukhov <[EMAIL PROTECTED]> wrote: > Certainly! It don't intent to replace this way of defining/modifining > properties. First, it is an example of "with" statement application. > Second, suggested approach allow to write your example in the > following way: > > class C

Re: [Python-3000] A new member for contextlib?

2008-04-04 Thread Barry Warsaw
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Apr 4, 2008, at 2:40 PM, Paul Moore wrote: > On 04/04/2008, Zaur Shibzoukhov <[EMAIL PROTECTED]> wrote: >> Certainly! It don't intent to replace this way of defining/modifining >> properties. First, it is an example of "with" statement application.

Re: [Python-3000] [Python-Dev] RELEASED Python 2.6a2 and 3.0a4

2008-04-04 Thread Gregor Lingl
Hi, something doesn't work as usual, at least for me: When I try to download the Python 2.6a2 release for Windows by clicking * Windows x86 MSI Installer (2.6a2) (sig)

Re: [Python-3000] A new member for contextlib?

2008-04-04 Thread Martin v. Löwis
> And you shouldn't call it "property" - that name is already builtin > (and it doesn't read right, see above). I can't think of a good name > that *does* read right in the context of "with ... as x", either. Of course, we non-native speakers are completely ignorant of "reads right" (even to the e

Re: [Python-3000] [Python-Dev] RELEASED Python 2.6a2 and 3.0a4

2008-04-04 Thread Martin v. Löwis
> Error 404: File not found That has a simple explanation: the file is not there because it just doesn't exist yet, which in turn is because I have problems creating it (which is in turn due to switching to Visual Studio 2008). Regards, Martin ___ Pytho

Re: [Python-3000] [Python-Dev] Python source code on Bazaar vcs

2008-04-04 Thread Barry Warsaw
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Mar 25, 2008, at 2:05 PM, [EMAIL PROTECTED] wrote: > >>> Did I misread the directions or do I really need the --create-prefix >>> arg? > >Barry> You do, the first time you push a user branch because > users/skip >Barry> doesn't exist yet.

Re: [Python-3000] A new member for contextlib?

2008-04-04 Thread Joel Bender
How about reversing the order? class C(object): with x as property: ... Joel ___ Python-3000 mailing list [email protected] http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman

Re: [Python-3000] Spooky behavior of dict.items() and friends

2008-04-04 Thread Jason Orendorff
On Wed, Apr 2, 2008 at 5:48 PM, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > In your code, how many (in absolute numbers) applications of .items() > would break when .items() becomes a view? Sorry for the slow response. Good question. In 25k lines of code (not mine but mostly written by peop

Re: [Python-3000] A new member for contextlib?

2008-04-04 Thread Benjamin Peterson
On Fri, Apr 4, 2008 at 2:28 PM, Joel Bender <[EMAIL PROTECTED]> wrote: > How about reversing the order? > > class C(object): > with x as property: > ... That is nicer but is not easy to implement. > > > Joel > ___ > Python-3000

[Python-3000] raw strings and \u

2008-04-04 Thread Neal Norwitz
I just checked in r62163 with this change: -rc = os.system(r"ml64 -c -Foms\uptable.obj ms\uptable.asm") +rc = os.system("ml64 -c -Foms\\uptable.obj ms\\uptable.asm") What should happen with raw unicode strings that contain a \u? The old code above was generating: SyntaxE