Re: [BangPypers] returning value from a class

2011-04-06 Thread Sidu Ponnappa
> So you'll actually build a redirection instead of just a response for > the 3xx status codes? Aye - the native Ruby HTTP libraries do no support an auto-follow-redirect feature and I wanted to add that to Wrest. So in Wrest, the Redirection class is a subclass of Response and overrides Response's

Re: [BangPypers] returning value from a class

2011-04-06 Thread Noufal Ibrahim
On Wed, Apr 06 2011, Sidu Ponnappa wrote: >> Why do you want to create a class that doesn't create itself when called? > It's interesting this came up today - we were just arguing about this > at work on Monday. Some of my colleagues are of the opinion that this > is a Bad Thing and should never b

Re: [BangPypers] returning value from a class

2011-04-06 Thread Sidu Ponnappa
> Why do you want to create a class that doesn't create itself when called? It's interesting this came up today - we were just arguing about this at work on Monday. Some of my colleagues are of the opinion that this is a Bad Thing and should never be done. I agree that while it's a bad thing, there

Re: [BangPypers] returning value from a class

2011-04-06 Thread Noufal Ibrahim
On Wed, Apr 06 2011, Nitin Kumar wrote: > Thanks a lot Noufal, > > I was just missing overloading object (i got remind of this after checking > your mail only) class in mine. > Thanks for the info in such detail. [...] So, what are you trying to do? -- __

Re: [BangPypers] returning value from a class

2011-04-06 Thread Nitin Kumar
Thanks a lot Noufal, I was just missing overloading object (i got remind of this after checking your mail only) class in mine. Thanks for the info in such detail. Nitin K On Wed, Apr 6, 2011 at 6:41 PM, Noufal Ibrahim wrote: > > You're opening up can of worms here but I'll try to sort it out s

Re: [BangPypers] returning value from a class

2011-04-06 Thread Noufal Ibrahim
You're opening up can of worms here but I'll try to sort it out since I'm feeling messed up anyway. First : Old style and new style classes --- "class X:" in Python 2.x creates an old style class[1] These classes were distinct from builtin "type"s. All such c

[BangPypers] returning value from a class

2011-04-06 Thread Nitin Kumar
Hi All, I am looking for a return value when an object is created. but can see different behavior in different python version. Python 3 gives >>> class x: def __new__(self): return 5 >>> x() 5 Python 2.6.5 gives >>> class x: def __new__(self): return 5 >>> x() <__main__.x instance at 0x017CFD