I have a class whose So I really want to call the However, there are a few ways you can do this: Just start the process normally - there is no reason that you will get the result of an expression Specify in a variable However, this will result in the creation of a complete object (and possibly possibly destruction soon). Built-in function call: This will not trigger the object creation, but you probably do not want to note that here In the example, I passed the value of 2a You can use staticmethod to make it easier: __ init __ function is a bunch of content, and it All i need
__init __ function of this class. How can I do this without assigning it to a variable? Firstly, it is clearly a design error - this code should be just a standalone function.
Foo ()
Foo___word __ Receive ('__ init __') (none)
a as the value of
self . This only works when
__init __
self does not do anything (or, it is where it handles
no )
in
[32]: square fu (object): ....: @staticmethod ....: def __init __ ( ): ... .print "Fu Init" ....: in [33]: Fu () Fu Init Out [33]:
Comments
Post a Comment