本文整理汇总了Python中pypy.module.unicodedata.unicodedb.istitle函数的典型用法代码示例。如果您正苦于以下问题:Python istitle函数的具体用法?Python istitle怎么用?Python istitle使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了istitle函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: descr_isupper
def descr_isupper(self, space):
cased = False
for uchar in self._value:
if unicodedb.islower(ord(uchar)) or unicodedb.istitle(ord(uchar)):
return space.w_False
if not cased and unicodedb.isupper(ord(uchar)):
cased = True
return space.newbool(cased)
示例2: unicode_isupper__Unicode
def unicode_isupper__Unicode(space, w_unicode):
cased = False
for uchar in w_unicode._value:
if unicodedb.islower(ord(uchar)) or unicodedb.istitle(ord(uchar)):
return space.w_False
if not cased and unicodedb.isupper(ord(uchar)):
cased = True
return space.newbool(cased)
示例3: unicode_istitle__Unicode
def unicode_istitle__Unicode(space, w_unicode):
cased = False
previous_is_cased = False
for uchar in w_unicode._value:
if unicodedb.isupper(ord(uchar)) or unicodedb.istitle(ord(uchar)):
if previous_is_cased:
return space.w_False
previous_is_cased = cased = True
elif unicodedb.islower(ord(uchar)):
if not previous_is_cased:
return space.w_False
previous_is_cased = cased = True
else:
previous_is_cased = False
return space.newbool(cased)
示例4: _istitle
def _istitle(self, ch):
return unicodedb.isupper(ord(ch)) or unicodedb.istitle(ord(ch))
示例5: Py_UNICODE_ISTITLE
def Py_UNICODE_ISTITLE(space, ch):
"""Return 1 or 0 depending on whether ch is a titlecase character."""
return unicodedb.istitle(ord(ch))