Re: c.l.py dead, news at 11 (was Re: Mangle function name with decorator?)

2009-04-03 Thread srepmub
On Mar 30, 4:36 pm, Michele Simionato michele.simion...@gmail.com wrote: On Mar 30, 3:31 pm, srepmub mark.duf...@gmail.com wrote: for the record, the input forShedskinis pure Python, so there is no added syntax or optional type declaration system. that said, I can understand it not being

Re: c.l.py dead, news at 11 (was Re: Mangle function name with decorator?)

2009-03-30 Thread Hendrik van Rooyen
Steven D'Aprano st...@rource.com.au wrote: Oh noes!!! Python will be just like nearly every other language!!! Including Python. There are already at least thirteen implementations (forks) of Python (although some of these are defunct or unmaintained): CPython Jython IronPython Python for

Re: c.l.py dead, news at 11 (was Re: Mangle function name with decorator?)

2009-03-30 Thread Paul Rubin
Hendrik van Rooyen m...@microcorp.co.za writes: Its kind of sad to see unladen swallow, which is just a promise, on the list, while Shedskin, which isn't, is ignored. Does this say something about big corporations vs the small man? I think the programs on the list were supposed to

Re: c.l.py dead, news at 11 (was Re: Mangle function name with decorator?)

2009-03-30 Thread srepmub
Its kind of sad to see unladen swallow, which is just a promise, on the list, whileShedskin, which isn't, is ignored. Does this say something about big corporations vs the small man? I think the programs on the list were supposed to actually implement Python and extensions of

Re: c.l.py dead, news at 11 (was Re: Mangle function name with decorator?)

2009-03-30 Thread Michele Simionato
On Mar 30, 3:31 pm, srepmub mark.duf...@gmail.com wrote: for the record, the input for Shedskin is pure Python, so there is no added syntax or optional type declaration system. that said, I can understand it not being on some list for not being production-ready. thanks, mark dufour. But

Re: c.l.py dead, news at 11 (was Re: Mangle function name with decorator?)

2009-03-30 Thread Steven D'Aprano
On Mon, 30 Mar 2009 09:46:40 +0200, Hendrik van Rooyen wrote: Its kind of sad to see unladen swallow, which is just a promise, on the list, while Shedskin, which isn't, is ignored. Does this say something about big corporations vs the small man? No, what it says is that I had just read a

Re: c.l.py dead, news at 11 (was Re: Mangle function name with decorator?)

2009-03-30 Thread Tim Golden
Steven D'Aprano wrote: On Mon, 30 Mar 2009 09:46:40 +0200, Hendrik van Rooyen wrote: Its kind of sad to see unladen swallow, which is just a promise, on the list, while Shedskin, which isn't, is ignored. Does this say something about big corporations vs the small man? No, what it says is

Re: c.l.py dead, news at 11 (was Re: Mangle function name with decorator?)

2009-03-29 Thread Aaron Brady
On Mar 29, 12:23 am, Steven D'Aprano st...@remove-this- cybersource.com.au wrote: On Fri, 27 Mar 2009 19:57:41 -0700, Aaron Brady wrote: I see how c-l-py doesn't represent the full interests of Python, Python is a *programming language*. It doesn't have interests. It just sits there, a bunch

Re: c.l.py dead, news at 11 (was Re: Mangle function name with decorator?)

2009-03-28 Thread Steven D'Aprano
On Fri, 27 Mar 2009 19:57:41 -0700, Aaron Brady wrote: I see how c-l-py doesn't represent the full interests of Python, Python is a *programming language*. It doesn't have interests. It just sits there, a bunch of bits on a disk, waiting to be used. *People* have interests, and Python is a

c.l.py dead, news at 11 (was Re: Mangle function name with decorator?)

2009-03-27 Thread Aahz
In article mailman.2130.1237391000.11746.python-l...@python.org, andrew cooke and...@acooke.org wrote: you are trying to do very deep things that most people do not do with python. that does not mean that there are no solutions, just that you have to find them yourself (especially with the

Re: c.l.py dead, news at 11 (was Re: Mangle function name with decorator?)

2009-03-27 Thread andrew cooke
Aahz wrote: Excuse me? What decline of this newsgroup? Hmmm. It's hard to respond to this without implicitly criticising others here, which wasn't my point at all. But my personal impression is that over the years various people who used to post here now stay pretty firmly in the dev group,

Re: c.l.py dead, news at 11 (was Re: Mangle function name with decorator?)

2009-03-27 Thread Aahz
In article mailman.2787.1238174158.11746.python-l...@python.org, andrew cooke and...@acooke.org wrote: Aahz wrote: Excuse me? What decline of this newsgroup? Hmmm. It's hard to respond to this without implicitly criticising others here, which wasn't my point at all. But my personal

Re: c.l.py dead, news at 11 (was Re: Mangle function name with decorator?)

2009-03-27 Thread Tim Chase
Aahz wrote: In article mailman.2130.1237391000.11746.python-l...@python.org, andrew cooke and...@acooke.org wrote: you are trying to do very deep things that most people do not do with python. that does not mean that there are no solutions, just that you have to find them yourself (especially

Re: c.l.py dead, news at 11 (was Re: Mangle function name with decorator?)

2009-03-27 Thread skip
Aahz Excuse me? What decline of this newsgroup? Andrew But my personal impression is that over the years various Andrew people who used to post here now stay pretty firmly in the dev Andrew group, while others seem to have disappeared more or less Andrew completely

Re: c.l.py dead, news at 11 (was Re: Mangle function name with decorator?)

2009-03-27 Thread Albert Hopkins
On Fri, 2009-03-27 at 10:47 -0700, Aahz wrote: In article mailman.2787.1238174158.11746.python-l...@python.org, andrew cooke and...@acooke.org wrote: Aahz wrote: Excuse me? What decline of this newsgroup? Hmmm. It's hard to respond to this without implicitly criticising others here,

Re: c.l.py dead, news at 11 (was Re: Mangle function name with decorator?)

2009-03-27 Thread skip
Albert For me declining means the rate of (non-spam) posts is steadily Albert dropping over time. I know this wasn't the main point of your post, but if you subscribe to python-list@python.org or read it via a mail-to-news gateway like Gmane I think you will find the ratio of spam to ham

Re: c.l.py dead, news at 11 (was Re: Mangle function name with decorator?)

2009-03-27 Thread Nick Craig-Wood
Aahz a...@pythoncraft.com wrote: Well, yes, but that's simply the nature of online fora (I originally wrote nature of Usenet, but I think it's more general than that). From my POV, if you're going to call it a decline, you need to provide more evidence than some people leaving and others

Re: c.l.py dead, news at 11 (was Re: Mangle function name with decorator?)

2009-03-27 Thread Aahz
In article slrngsq9rb.uia.n...@irishsea.home.craig-wood.com, Nick Craig-Wood n...@craig-wood.com wrote: c.l.py is my favourite usenet group and has been for some time. I've been doing usenet for 16 years now! Newbie. ;-) -- Aahz (a...@pythoncraft.com) *

Re: c.l.py dead, news at 11 (was Re: Mangle function name with decorator?)

2009-03-27 Thread Erik Max Francis
Albert Hopkins wrote: I agree. If the argument is simply that some devs no longer hang here but do on -dev than that's not declining to me, especially as the amount of traffic on -dev increases. That's ordinary. Same for people coming and going. For me declining means the rate of (non-spam)

Re: c.l.py dead, news at 11 (was Re: Mangle function name with decorator?)

2009-03-27 Thread andrew cooke
Erik Max Francis wrote: [...] And made all purdy-like: http://www.alcyone.com/tmp/python-list%20traffic.pdf That's very pretty, but neither the volume of posts, nor the quality of the people posting here is really what I was talking about. I don't think I explained very well, but seeing

Re: c.l.py dead, news at 11 (was Re: Mangle function name with decorator?)

2009-03-27 Thread Albert Hopkins
On Fri, 2009-03-27 at 21:15 -0400, andrew cooke wrote: [...] c.l.python used to be the core of a community built around a language. It no longer is. It is a very useful place, where some very helpful and knowledgeable people hang out and give advice, but instead of representing the full

Re: c.l.py dead, news at 11 (was Re: Mangle function name with decorator?)

2009-03-27 Thread Aaron Brady
On Mar 27, 8:15 pm, andrew cooke and...@acooke.org wrote: Erik Max Francis wrote: [...] And made all purdy-like:    http://www.alcyone.com/tmp/python-list%20traffic.pdf That's very pretty, but neither the volume of posts, nor the quality of the people posting here is really what I was

Re: c.l.py dead, news at 11 (was Re: Mangle function name with decorator?)

2009-03-27 Thread skip
Andrew c.l.python used to be the core of a community built around a Andrew language. It no longer is. It is a very useful place, where Andrew some very helpful and knowledgeable people hang out and give Andrew advice, but instead of representing the full interests of the

Re: c.l.py dead, news at 11 (was Re: Mangle function name with decorator?)

2009-03-27 Thread Aahz
In article mailman.2814.1238202924.11746.python-l...@python.org, andrew cooke and...@acooke.org wrote: c.l.python used to be the core of a community built around a language. It no longer is. It is a very useful place, where some very helpful and knowledgeable people hang out and give advice,

Re: Mangle function name with decorator?

2009-03-25 Thread J. Cliff Dyer
On Wed, 2009-03-18 at 08:18 -0700, Adam wrote: On Mar 18, 10:33 am, J. Cliff Dyer j...@sdf.lonestar.org wrote: You might be interested in redefining __getattribute__(self, attr) on your class. This could operate in conjunction with the hash tables (dictionaries) mentioned by andrew cooke.

Re: Mangle function name with decorator?

2009-03-18 Thread Adam
On Mar 17, 1:49 pm, Aaron Brady castiro...@gmail.com wrote: You would need a unique attribute to look for on values in the dictionary, which means you'd need to detect what functions you are renaming; possibly by using a decorator to mark them.  (Untested:) class X( metaclass= M ):   @mark(

Re: Mangle function name with decorator?

2009-03-18 Thread J. Cliff Dyer
You might be interested in redefining __getattribute__(self, attr) on your class. This could operate in conjunction with the hash tables (dictionaries) mentioned by andrew cooke. i.e. (untested code): class C(object): def __init__(self): self._get_table = {} self._post_table

Re: Mangle function name with decorator?

2009-03-18 Thread R. David Murray
class foo_controller(Controller): __metaclass__= ControllerMetaclass def __init__(self, action, method = None): self.action = action self.method = method def foo(self): print in foo() @get_only def foo(self): print in get_only

Re: Mangle function name with decorator?

2009-03-18 Thread Adam
On Mar 18, 10:33 am, J. Cliff Dyer j...@sdf.lonestar.org wrote: You might be interested in redefining __getattribute__(self, attr) on your class.  This could operate in conjunction with the hash tables (dictionaries) mentioned by andrew cooke.  i.e. (untested code): class C(object):     def

Re: Mangle function name with decorator?

2009-03-18 Thread Adam
On Mar 18, 11:11 am, R. David Murray rdmur...@bitdance.com wrote: I don't have any wisdom on the metaclass/decorator stuff, but what about slightly reformulating the interface?  Instead of having the programmer type, eg:     @GET     def foo(self): pass     @POST     def foo(self): pass

Re: Mangle function name with decorator?

2009-03-18 Thread Michele Simionato
On Mar 18, 4:18 pm, Adam adam.crossl...@gmail.com wrote: Hey, Cliff.  Thanks for sharing this idea.  Unfortunately, providing a way to actually call the method with the mangled name is relatively easy, and there are options there.  The real issue, to me, seems to be finding a way to prevent

Re: Mangle function name with decorator?

2009-03-18 Thread andrew cooke
Adam wrote: Hey, Cliff. Thanks for sharing this idea. Unfortunately, providing a way to actually call the method with the mangled name is relatively easy, and there are options there. The real issue, to me, seems to be finding a way to prevent Python from eating all but the last version of

Re: Mangle function name with decorator?

2009-03-18 Thread R. David Murray
Adam adam.crossl...@gmail.com wrote: David, would you believe that I just posted about this very idea, It doesn't seem to have shown up yet, though. This idea works from the perspective of being trivially easy to implement. I can easily write a metaclass that looks in the namespace for

Re: Mangle function name with decorator?

2009-03-18 Thread Aaron Brady
On Mar 18, 8:47 am, Adam adam.crossl...@gmail.com wrote: On Mar 17, 1:49 pm, Aaron Brady castiro...@gmail.com wrote: You would need a unique attribute to look for on values in the dictionary, which means you'd need to detect what functions you are renaming; possibly by using a decorator

Mangle function name with decorator?

2009-03-17 Thread Adam
I am using Python 2.5, and I would like to write a decorator (or using some other elegant, declarative approach) to mangle the name of function in a class. I would like to be able to have two methods declared with the same name, but one of them will have a decorator (or whatever) that will change

Re: Mangle function name with decorator?

2009-03-17 Thread andrew cooke
Adam wrote: class A(object): def __init__(self, method, usebar = False): self.method = method self.usebar = usebar def __call__(self): if self.usebar == True: mangled_name = _bar_ + self.method if hasattr(self, mangled_name):

Re: Mangle function name with decorator?

2009-03-17 Thread Adam
Thanks, Andrew. I'm trying to accomplish something with a metaprogramming flavor, where, for the convenience of the programmer and the clarity of code, I'd like to have a decorator or some other mechanism do twiddling behind the scenes to make a class do something it wouldn't normally do. Here's

Re: Mangle function name with decorator?

2009-03-17 Thread Aaron Brady
On Mar 17, 12:20 pm, Adam adam.crossl...@gmail.com wrote: Thanks, Andrew.  I'm trying to accomplish something with a metaprogramming flavor, where, for the convenience of the programmer and the clarity of code, I'd like to have a decorator or some other mechanism do twiddling behind the scenes

Re: Mangle function name with decorator?

2009-03-17 Thread andrew cooke
ah, ok. then yes, you can do that with decorators. you'd need hash tables or something similar in a metaclass. then the decorator would take the given function, stick it in the appropriate hash table, and return a function that does the dispatch (ie at run time does the lookup from the hash

Re: Mangle function name with decorator?

2009-03-17 Thread Aaron Brady
at bottom On Mar 17, 12:54 pm, andrew cooke and...@acooke.org wrote: ah, ok.  then yes, you can do that with decorators.  you'd need hash tables or something similar in a metaclass.  then the decorator would take the given function, stick it in the appropriate hash table, and return a function

Re: Mangle function name with decorator?

2009-03-17 Thread Michele Simionato
On Mar 17, 7:45 pm, Aaron Brady castiro...@gmail.com wrote: (Perhaps someday, we will be able to write: def dec( namespace ):   def outer( fun ):     if fun.__name__ in namespace:       namespace[ dup_var ]= namespace[ fun.__name__ ]     return fun   return outer It allows us to see if

Re: Mangle function name with decorator?

2009-03-17 Thread Michele Simionato
I forgot; people interested in metaclasses in Python 3.0 will want to read this paper: http://www.artima.com/weblogs/viewpost.jsp?thread=236234 -- http://mail.python.org/mailman/listinfo/python-list