python中sys._getframe() 是要怎么样的环境才有
CPython和PyPy都是支持的,但是还有IronPython、Jython等等不同的解释器,这个只是CPython导入的用于内部功能(比如inspect、traceback可能会用)的接口,其他解释器中,inspect和traceback的功能会跟文档一致,但不一定也是用_getframe实现,所以最好是调用那些库
■网友
Oh my, just run the function and catch the exception. Don\u0026#39;t you know what exception is used for?
■网友
下划线开头的成员属于“具体的实现细节”吧,这种不属于外部接口的东西,将来有可能被去除或者改换名字。
■网友
你再看这一句:CPython implementation detail: The gettrace() function is intended only for implementing debuggers, profilers, coverage tools and the like. Its behavior is part of the implementation platform, rather than part of the language definition, and thus may not be available in all Python implementations.也就是说,python 在不同的平台可能有不同的实现,不保证每种实现都有这种方法,与平台支持等有关系。
推荐阅读
- 怎样成为一名合格的Python程序员?
- python 爬虫,咋获得输入验证码之后的搜索结果
- python的html5lib这个库咋使用啊我在网上也没有找到相关文档
- 零基础入门学习啥语言好
- Python3.4和3.5区别大么
- python 中 def_():...... return _有啥作用
- 新互联网网站用Java还靠谱么对比Php,Python,Ruby的话
- 30岁男,创业失败转行学python,是否很晚?也不好找工作?
- Python 的开发速度比 C#.net 或 Vb.net 更快吗?
- 16年毕业,建筑环境与设备工程专业,干的一直是工程想转IT专业,想从python入手请问咋开始学习
