Re: 'new' module deprecation in python2.6

2008-11-29 Thread Michael Crute
On Sat, Nov 29, 2008 at 11:52 AM, David Pratt [EMAIL PROTECTED] wrote: Can someone tell me why 'new' has been deprecated in python 2.6 and provide direction for code that uses new for the future. I find new is invaluable for some forms of automation. I don't see a replacement for python 3

Re: 'new' module deprecation in python2.6

2008-11-29 Thread David Pratt
Hi Mike. Many thanks for your reply and thank you for reference. I have code that looks like the following so initially looking at what will need to be done as it doesn't appear new will survive. So first need to find way of translating this sort of thing using types. I see there is a

Re: 'new' module deprecation in python2.6

2008-11-29 Thread Rob Williscroft
David Pratt wrote in news:mailman.4664.1227980181.3487.python- [EMAIL PROTECTED] in comp.lang.python: import new class FirstBase(object): foo = 'bar' biz = 'baz' class SecondBase(object): bla = 'blu' buz = 'brr' attr = { 'fiz': 'An attribute', 'fuz':

Re: 'new' module deprecation in python2.6

2008-11-29 Thread David Pratt
Yeah, can just use types.ClassType instead of new.classobj, but still wonder what happens when we get to python 3. Regards, David On Nov 29, 2008, at 1:04 PM, Michael Crute wrote: On Sat, Nov 29, 2008 at 11:52 AM, David Pratt [EMAIL PROTECTED] wrote: Can someone tell me why 'new' has been

Re: 'new' module deprecation in python2.6

2008-11-29 Thread Christian Heimes
David Pratt wrote: Hi Mike. Many thanks for your reply and thank you for reference. I have code that looks like the following so initially looking at what will need to be done as it doesn't appear new will survive. So first need to find way of translating this sort of thing using types. I see

Re: 'new' module deprecation in python2.6

2008-11-29 Thread David Pratt
Rob. Sweet! Many thanks. Regards, David On Nov 29, 2008, at 1:46 PM, Rob Williscroft wrote: David Pratt wrote in news:mailman.4664.1227980181.3487.python- [EMAIL PROTECTED] in comp.lang.python: import new class FirstBase(object): foo = 'bar' biz = 'baz' class

Re: 'new' module deprecation in python2.6

2008-11-29 Thread David Pratt
Hey Christian. Many thanks for explanation. Clears that up :-) Regards, David On Nov 29, 2008, at 1:52 PM, Christian Heimes wrote: David Pratt wrote: Hi Mike. Many thanks for your reply and thank you for reference. I have code that looks like the following so initially looking at what

Re: 'new' module deprecation in python2.6

2008-11-29 Thread Scott David Daniels
David Pratt wrote: ... import new class FirstBase(object): foo = 'bar' biz = 'baz' class SecondBase(object): bla = 'blu' buz = 'brr' attr = { 'fiz': 'An attribute', 'fuz': 'Another one'} Test = new.classobj( ^^^ replace with: Test = type( 'Test', (FirstBase,