Jun-19-2020, 06:41 AM
(This post was last modified: Jun-19-2020, 06:43 AM by rudihammad.)
Ok let me explain it with a very simple example then.
I know the following doesn't work but it to shows what I am trying to do.
I know the following doesn't work but it to shows what I am trying to do.
class Foo(object): def __new__(cls): cls.someVar = 5 return cls.someVar def asList(): return [cls.someVar] f = Foo() # Resutl: 5 f.asList() # <-- I would like be able to do this and get: [5]I get why it doesn't work, because f return an integer and it doesn't have that asList() method. So basically what I meant is if it possible to do what I intended in code above.