简体   繁体   English

Python Extension-thingy的正确名称是什么?

[英]What's the correct name for a Python Extension-thingy?

Is it: 是吗:

  • Extension class 扩展类
  • Extension type 扩展类型
  • Extension object 扩展对象

?

Could somebody disambiguate? 有人能消除歧义吗?

I'm asking because I have the following object structure in my C++ code, and I'm trying to figure out whether I should revise the names before I release my code: 我之所以问是因为我的C ++代码中具有以下对象结构,并且我试图弄清楚在发布代码之前是否应该修改名称:

class ExtObjBase_noTemplate : public PyObject


template< typename FinalClass >
class ExtObjBase : public FuncMapper<FinalClass> , public ExtObjBase_noTemplate


// - - - - - - - 

template<typename FinalClass>
class ExtObj_old : public ExtObjBase<FinalClass>

template<typename FinalClass>
class ExtObj_new : public ExtObjBase<FinalClass>


//= = = = = = = = = = = 
//CONSUMER does:

class new_style_class: public ExtObj_new< new_style_class >

class old_style_class: public ExtObj_old< old_style_class >

Extension class , Extension type : 扩展类扩展类型

These are synonyms, if we ignore classic (old-style) classes. 如果我们忽略经典(旧式)类,则这些是同义词。 They refer to classes or types created in extension modules. 它们引用在扩展模块中创建的类或类型。

Sometimes, we do care about classic classes. 有时,我们确实关心经典课程。 New-style classes are types. 新型类是类型。 Classic classes are not types. 经典类不是类型。 I don't recommend working with classic classes in new code. 我不建议在新代码中使用经典类。 They have been removed in Python 3. 它们已在Python 3中删除。

Extension object 扩展对象

I've not heard this term before, but I would assume it refers to an instance of an extension class/type. 我以前没有听说过这个术语,但是我认为它是指扩展类/类型的实例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM