Re: class-based class decorator

2015-01-15 Thread Albert-Jan Roskam
- Original Message - > From: Jean-Michel Pichavant > To: Albert-Jan Roskam > Cc: Python > Sent: Tuesday, January 13, 2015 5:37 PM > Subject: Re: class-based class decorator > > - Original Message - >> From: "Albert-Jan Roskam" >&

Re: class-based class decorator

2015-01-13 Thread Jean-Michel Pichavant
- Original Message - > From: "Albert-Jan Roskam" > > From: Jean-Michel Pichavant > > I don't really understand how you successfuly manage positional > > parameters, > > since the caller may not name them. > > I'm asking because if your intend to check only the keyword > > parameters, > >

Re: class-based class decorator

2015-01-13 Thread Albert-Jan Roskam
On Tue, Jan 13, 2015 6:31 AM CET Ian Kelly wrote: >On Jan 12, 2015 6:47 AM, "Albert-Jan Roskam" wrote: >> Thanks for your replies. I changed it into a regular decorator (not a class >> decorator). It would have been even nicer if I only needed to specify it >> once

Re: class-based class decorator

2015-01-13 Thread Albert-Jan Roskam
- Original Message - > From: Jean-Michel Pichavant > To: Albert-Jan Roskam > Cc: Python > Sent: Monday, January 12, 2015 4:20 PM > Subject: Re: class-based class decorator > > - Original Message - >> From: "Albert-Jan Roskam" >

Re: class-based class decorator

2015-01-12 Thread Ian Kelly
On Jan 12, 2015 6:47 AM, "Albert-Jan Roskam" wrote: > Thanks for your replies. I changed it into a regular decorator (not a class > decorator). It would have been even nicer if I only needed to specify it once > per class, but, well, in my case this hardly matters. The code below works as > int

Re: class-based class decorator

2015-01-12 Thread Jean-Michel Pichavant
- Original Message - > From: "Albert-Jan Roskam" > import functools > import inspect > import warnings > > warnings.simplefilter("always") > > class check_deprecated_args(object): > > def __init__(self, deprecated_params, msg=None): > self.deprecated_params = deprecated_para

Re: class-based class decorator

2015-01-12 Thread Albert-Jan Roskam
- Original Message - > From: Ian Kelly > To: Python > Cc: > Sent: Saturday, January 10, 2015 7:30 AM > Subject: Re: class-based class decorator > > On Fri, Jan 9, 2015 at 2:26 PM, Albert-Jan Roskam > > wrote: >> >> >> Hi, >&g

Re: class-based class decorator

2015-01-09 Thread Ian Kelly
On Fri, Jan 9, 2015 at 2:26 PM, Albert-Jan Roskam wrote: > > > Hi, > > I am trying to write a class decorator that checks whether deprecated > parameters with non-default > > arguments are used. More complete code is here: http://pastebin.com/ZqnMis6M. > In the code below, > > how should I modif

Re: class-based class decorator

2015-01-09 Thread Chris Angelico
On Sat, Jan 10, 2015 at 8:26 AM, Albert-Jan Roskam wrote: > I am trying to write a class decorator that checks whether deprecated > parameters with non-default > > arguments are used. More complete code is here: http://pastebin.com/ZqnMis6M. > In the code below, > Any particular reason to make

class-based class decorator

2015-01-09 Thread Albert-Jan Roskam
Hi, I am trying to write a class decorator that checks whether deprecated parameters with non-default arguments are used. More complete code is here: http://pastebin.com/ZqnMis6M. In the code below, how should I modify __call__ such that f.bar(old="oh no") prints "hello world"? I thought it