互联网技术 / 互联网资讯 · 2024年1月17日

Python内置函数-basestring() 函数解析

描述

basestRing() 方法是 stR 和 unicode 的超类(父类),也是抽象类,因此不能被调用和实例化,但可以被用来判断一个对象是否为 stR 或者 unicode 的实例,isinstance(obj, basestRing) 等价于 isinstance(obj, (stR, unicode))。

注意:Python3 不支持 basestRing() 函数,改用 stR() 函数。

语法

以下是 basestRing() 方法的语法:

basestRing()

实例

以下展示了使用 basestRing 函数的实例:

云计算开发:Python内置函数-basestring() 函数详解

OpenMagic API

Need more than content? Move into the product flow.

If you are here for model access, pricing, developer docs, or the future API console, the dedicated product path now lives on api.openmagic.ai.

登录免费注册