如何在python中使用@classmethod和@staticmethods [英] how to use the @classmethod and @staticmethods in python

查看:119
本文介绍了如何在python中使用@classmethod和@staticmethods的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是python中的测试自动化程序员。我没有在python中探索很多功能,因为我所做的工作很简单,python功能的数量较少。我想增加python功能的知识,所以我想知道python中的@classmethod和@staticmethod我也在网上搜索过例如但是示例程序很简单,用法很小所以我会喜欢在python中对@classmethod和@staticmethod有一些扩展的知识。请帮我一些更好的教程。谢谢你提前。

解决方案

请参阅: http://www.pythoncentral.io/difference-静态方法和类方法在python 之间。



更好的教程?我可以问你原始文件有什么问题吗?请参阅: https://docs.python。 org / 3



这是原始教程: https://docs.python.org/3/tutorial/index.html



有什么问题吗?



-SA

I am a test automation programmer in python. I have not explored lot for features in python because the work that i do is quiet simple with the less amount of the python features. I would like to increase the knowledge of the python features so i would like to know the @classmethod and @staticmethod in python i have also searched in the internet for example but the example programs are very easy and the usage is very small so i would like to have some extended knowledge of the @classmethod and @staticmethod in python. Please help me with some better tutorials. Thanks in advanced.

解决方案

Please see: http://www.pythoncentral.io/difference-between-staticmethod-and-classmethod-in-python.

Better tutorial? May I ask you what's wrong with original documentation? Look: https://docs.python.org/3.

And this is the original tutorial: https://docs.python.org/3/tutorial/index.html.

Anything wrong with it?

—SA


这篇关于如何在python中使用@classmethod和@staticmethods的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆