在互动直播页面下载了IOS和android的Demo,但IOS下载下来的包里面有一个叫随心播的,效果很好,但android的包里却只有一个比较简陋的多方通话,请问哪一个才是互动直播。对这一块不是很了解。请详细解释一下,谢谢了
Python需要指定Self。您可以编写一个类,而不知道它可能有哪些基类,并且始终知道您是否正在访问一个成员:
class A(some_function()):
def f(self):
self.member = 42
self.method()
那是完全密码!(一些)_函数返回用作基的类型。)
Another, where the methods of a class are dynamically composed:
class B(object):
pass
print B()
# <__main__.B object at 0xb7e4082c>
def B_init(self):
self.answer = 42
def B_str(self):
return "<The answer is %s.>" % self.answer
# notice these functions require no knowledge of the actual class
# how hard are they to read and realize that "members" are used?
B.__init__ = B_init
B.__str__ = B_str
print B()
# <The answer is 42.>
请记住,这两个例子都是极端的,您不会每天都看到它们,我也不建议您经常编写这样的代码,但它们确实清楚地显示了自我被明确要求的方面。