[Tutor] Class vs. instance

Stayvoid stayvoid at gmail.com
Wed Jan 18 03:13:34 CET 2012


Hello!

Here is another one.

class A:
	def __init__(self, data):
		self.data = data
		print self.data

I'm trying to understand this function-like syntax:
A('foo').__init__(42)
A(12).data

What are we actually calling this way?
Are there any other ways to get the same result?


Cheers.


More information about the Tutor mailing list