Vijairaj <[EMAIL PROTECTED]> wrote:
> Thanks Dylan and Alex, that was a new learning for me.
>
> but both the solutions don't work in jython 2.1 is there an alternative
> that will work with jython2.1
Alas, no: your simple idea is essentially the best you can do in any
implementation of Pyhon at
Dylan Moreland <[EMAIL PROTECTED]> wrote:
...
> > do not use old-style classes: they exist ONLY for backwards
> > compatibility.
...
> > and you can call Test.__subclasses__() to get a list of all extant
> > subclassed of Test at any time.
...
> Thanks Alex. That's a new one to me -- new-s
Alex Martelli wrote:
> Vijairaj R <[EMAIL PROTECTED]> wrote:
>...
> > class Test:
>
> do not use old-style classes: they exist ONLY for backwards
> compatibility.
>
> Make you class Test new-style:
>
> class Test(object):
>...
>
>
> and you can call Test.__subclasses__() to get a list of a
Thanks Dylan and Alex, that was a new learning for me.
but both the solutions don't work in jython 2.1 is there an alternative
that will work with jython2.1
--
Thanks,
Vijairaj
--
http://mail.python.org/mailman/listinfo/python-list
Vijairaj R <[EMAIL PROTECTED]> wrote:
...
> class Test:
do not use old-style classes: they exist ONLY for backwards
compatibility.
Make you class Test new-style:
class Test(object):
...
and you can call Test.__subclasses__() to get a list of all extant
subclassed of Test at any time.
Hi,
I have a requirement to findout all the classes that are derived from a
single base class.
This is how I do it currently.
class Test:
case = []
class Test1(Test):
Test.case.append("Test1")
class Test2(Test):
Test.case.append("Test2")
1. Is there a better way of doing this.
2. I
Vijairaj R wrote:
> Hi,
> I have a requirement to findout all the classes that are derived from a
> single base class.
>
> This is how I do it currently.
>
> class Test:
> case = []
>
> class Test1(Test):
> Test.case.append("Test1")
>
> class Test2(Test):
> Test.case.append("Test2")
>