Demo entry 5865375

dd

   

Submitted by anonymous on Aug 20, 2016 at 12:11
Language: Python 3. Code size: 135 Bytes.

class Base有私有属性 __z
class C(Base):
	def print_z(self):
		print(self._Base__z)挂上_父类名即可访问到.
c = C()
c.print_z()				可以输出父类私有变量.

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).