Re: [Python-Dev] Divorcing str and unicode (no more implicit conversions).

2005-10-16 Thread Martin v. Löwis
Martin Blais wrote: >>Yes. setdefaultencoding() is removed from sys by site.py. To get it >>again you must reload sys. > > > Thanks. Actually, I should take the opportunity to advise people that setdefaultencoding doesn't really work. With the default default encoding, strings and Unicode object

Re: [Python-Dev] problem with genexp

2005-10-16 Thread Neal Norwitz
On 10/10/05, Neal Norwitz <[EMAIL PROTECTED]> wrote: > There's a problem with genexp's that I think really needs to get > fixed. See http://python.org/sf/1167751 the details are below. This > code: > > >>> foo(a = i for i in range(10)) > > I agree with the bug report that the code should either r

Re: [Python-Dev] Definining properties - a use case for classdecorators?

2005-10-16 Thread Delaney, Timothy (Tim)
Guido van Rossum wrote: > To which Tim Delaney responded, "have a look at my response here:" > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/408713 > > I looked at that, and now I believe it's actually *better* to mention > the property name twice, at least compared to Tim' s approach.

Re: [Python-Dev] Autoloading? (Making Queue.Queue easier to use)

2005-10-16 Thread Steven Bethard
Nick Coghlan wrote: > Having module attribute access obey the descriptor protocol (__get__, __set__, > __delete__) sounds like a pretty good option to me. > > It would even be pretty backwards compatible, as I'd be hardpressed to think > why anyone would have a descriptor *instance* as a top-level

Re: [Python-Dev] AST branch merge status

2005-10-16 Thread Jeremy Hylton
Real life interfered with the planned merge tonight. I hope you'll all excuse and wait until tomorrow night. Jeremy On 10/16/05, Jeremy Hylton <[EMAIL PROTECTED]> wrote: > I just merged the head back to the AST branch for what I hope is the > last time. I plan to merge the branch to the head on

[Python-Dev] Guido v. Python, Round 1

2005-10-16 Thread Neal Norwitz
We all know Guido likes Python. But the real question is do pythons like Guido? http://python.org/neal/ n ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailma

Re: [Python-Dev] Definining properties - a use case for class decorators?

2005-10-16 Thread Guido van Rossum
[Guido] > > Nick, and everybody else trying to find a "solution" for this > > "problem", please don't. [Greg Ewing] > Denying that there's a problem isn't going to make it > go away. Many people, including me, have the feeling that > the standard way of defining properties at the moment leaves > s

Re: [Python-Dev] Definining properties - a use case for class decorators?

2005-10-16 Thread Delaney, Timothy (Tim)
Greg Ewing wrote: >class C: > > foo = overridable_property('foo', "The foo property") > > def get_foo(self): >... > > def set_foo(self, x): >... > > This has the advantage that the accessor methods can be > overridden in subclasses with the expected effect.

Re: [Python-Dev] Definining properties - a use case for class decorators?

2005-10-16 Thread Greg Ewing
Guido van Rossum wrote: > Nick, and everybody else trying to find a "solution" for this > "problem", please don't. Denying that there's a problem isn't going to make it go away. Many people, including me, have the feeling that the standard way of defining properties at the moment leaves something

Re: [Python-Dev] Divorcing str and unicode (no more implicit conversions).

2005-10-16 Thread Martin Blais
On 10/15/05, Reinhold Birkenfeld <[EMAIL PROTECTED]> wrote: > Martin Blais wrote: > > On 10/3/05, Michael Hudson <[EMAIL PROTECTED]> wrote: > >> Martin Blais <[EMAIL PROTECTED]> writes: > >> > >> > How hard would that be to implement? > >> > >> import sys > >> reload(sys) > >> sys.setdefaultencodin

Re: [Python-Dev] Early PEP draft (For Python 3000?)

2005-10-16 Thread Calvin Spealman
On 10/16/05, Josiah Carlson <[EMAIL PROTECTED]> wrote: > > Calvin Spealman <[EMAIL PROTECTED]> wrote: > > > > On 10/14/05, Josiah Carlson <[EMAIL PROTECTED]> wrote: > > > > > > Calvin Spealman <[EMAIL PROTECTED]> wrote: > > > > > > > > On 10/11/05, Eyal Lotem <[EMAIL PROTECTED]> wrote: > > > > >

Re: [Python-Dev] Early PEP draft (For Python 3000?)

2005-10-16 Thread Josiah Carlson
Calvin Spealman <[EMAIL PROTECTED]> wrote: > > On 10/14/05, Josiah Carlson <[EMAIL PROTECTED]> wrote: > > > > Calvin Spealman <[EMAIL PROTECTED]> wrote: > > > > > > On 10/11/05, Eyal Lotem <[EMAIL PROTECTED]> wrote: > > > > locals()['x'] = 1 # Quietly fails! > > > > Replaced by: > > > >

Re: [Python-Dev] Unicode charmap decoders slow

2005-10-16 Thread Martin v. Löwis
Tony Nelson wrote: > Umm, 0 (NUL) is a valid output character in most of the 8-bit character > sets. It could be handled by having a separate "exceptions" string of the > unicode code points that actually map to the exception char. Yes. But only U+ should normally map to 0. It could be specia

Re: [Python-Dev] Definining properties - a use case for class decorators?

2005-10-16 Thread Guido van Rossum
On 10/16/05, Calvin Spealman <[EMAIL PROTECTED]> wrote: > On 10/16/05, Guido van Rossum <[EMAIL PROTECTED]> wrote: > > Nick, and everybody else trying to find a "solution" for this > > "problem", please don't. There's nothing wrong with having the three > > accessor methods explicitly in the namesp

Re: [Python-Dev] Early PEP draft (For Python 3000?)

2005-10-16 Thread Calvin Spealman
On 10/14/05, Josiah Carlson <[EMAIL PROTECTED]> wrote: > > Calvin Spealman <[EMAIL PROTECTED]> wrote: > > > > On 10/11/05, Eyal Lotem <[EMAIL PROTECTED]> wrote: > > > locals()['x'] = 1 # Quietly fails! > > > Replaced by: > > > frame.x = 1 # Raises error > > > > What about the possibilit

Re: [Python-Dev] Definining properties - a use case for class decorators?

2005-10-16 Thread Calvin Spealman
On 10/16/05, Guido van Rossum <[EMAIL PROTECTED]> wrote: > On 10/16/05, Nick Coghlan <[EMAIL PROTECTED]> wrote: > > On and off, I've been looking for an elegant way to handle properties using > > decorators. > > > > It hasn't really worked, because decorators are inherently single function, > > and

Re: [Python-Dev] PEP 343 updated

2005-10-16 Thread Andrew Koenig
> PEP 343 has been updated on python.org. > Highlights of the changes: >- changed the name of the PEP to be simply "The 'with' Statement" Do you mean PEP 346, perchance? PEP 343 is something else entirely. ___ Python-Dev mailing list Python-Dev

Re: [Python-Dev] Definining properties - a use case for class decorators?

2005-10-16 Thread Guido van Rossum
On 10/16/05, Nick Coghlan <[EMAIL PROTECTED]> wrote: > On and off, I've been looking for an elegant way to handle properties using > decorators. > > It hasn't really worked, because decorators are inherently single function, > and properties span multiple functions. > > However, it occurred to me t

Re: [Python-Dev] PEP 343 updated

2005-10-16 Thread Guido van Rossum
On 10/16/05, Nick Coghlan <[EMAIL PROTECTED]> wrote: > PEP 343 has been updated on python.org. > > Highlights of the changes: > >- changed the name of the PEP to be simply "The 'with' Statement" >- added __with__() method >- added section on standard terminology (that is, contexts/conte

Re: [Python-Dev] Definining properties - a use case for class decorators?

2005-10-16 Thread Gary Poster
On Oct 16, 2005, at 9:56 AM, Nick Coghlan wrote: > On and off, I've been looking for an elegant way to handle > properties using > decorators. This isn't my idea, and it might have been brought up here in the past to the same sorts of screams of horror to which you refer later, but I use t

Re: [Python-Dev] Definining properties - a use case for class decorators?

2005-10-16 Thread Antoine Pitrou
>class Demo(object): > @def_property > class test: > """This is a test property""" > def get(self): > print "Getting attribute on instance" > def set(self, value): > print "Setting attribute on instance" > def dele

[Python-Dev] Definining properties - a use case for class decorators?

2005-10-16 Thread Nick Coghlan
On and off, I've been looking for an elegant way to handle properties using decorators. It hasn't really worked, because decorators are inherently single function, and properties span multiple functions. However, it occurred to me that Python already contains a construct for grouping multiple

[Python-Dev] PEP 343 updated

2005-10-16 Thread Nick Coghlan
PEP 343 has been updated on python.org. Highlights of the changes: - changed the name of the PEP to be simply "The 'with' Statement" - added __with__() method - added section on standard terminology (that is, contexts/context managers) - changed generator context decorator name to "co

Re: [Python-Dev] Unicode charmap decoders slow

2005-10-16 Thread Martin v. Löwis
Tony Nelson wrote: > BTW, Martin, if you care to, would you explain to me how a Trie would be > used for charmap encoding? I know a couple of approaches, but I don't know > how to do it fast. (I've never actually had the occasion to use a Trie.) I currently envision a three-level trie, with 5, 4