修饰符

#!/usr/bin/env python
# -*- coding:utf-8 -*-

class Provice:
# 静态方法
country = "中国"

def __init__(self,name):
temp = "xxx"
self.name = name
# 静态方法
@staticmethod
def xo(arg1, arg2):
print('xo')

# 普通方法,类中
def show(self):
print(self.name)

# 类方法
@classmethod
def xxoo(cls):
print('xxoo')


Provice.xo(1,2)
Provice.xxoo()
posted @ 2019-11-17 11:55  bingolives  阅读(19)  评论(0)    收藏  举报