本文整理汇总了Python中orgmode.liborgmode.documents.MultiPurposeList.__setitem__方法的典型用法代码示例。如果您正苦于以下问题:Python MultiPurposeList.__setitem__方法的具体用法?Python MultiPurposeList.__setitem__怎么用?Python MultiPurposeList.__setitem__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类orgmode.liborgmode.documents.MultiPurposeList
的用法示例。
在下文中一共展示了MultiPurposeList.__setitem__方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __setitem__
# 需要导入模块: from orgmode.liborgmode.documents import MultiPurposeList [as 别名]
# 或者: from orgmode.liborgmode.documents.MultiPurposeList import __setitem__ [as 别名]
def __setitem__(self, i, item):
if isinstance(i, slice):
o = []
o_tmp = item
if type(o_tmp) not in (list, tuple) and not isinstance(o_tmp, UserList):
o_tmp = list(o_tmp)
for item in o_tmp:
if type(item) == unicode:
o.append(u_encode(item))
else:
o.append(item)
MultiPurposeList.__setitem__(self, i, o)
else:
_i = item
if type(_i) is unicode:
_i = u_encode(item)
# TODO: fix this bug properly, it is really strange that it fails on
# python3 without it. Problem is that when _i = ['* '] it fails in
# UserList.__setitem__() but if it is changed in debuggr in __setitem__
# like item[0] = '* ' it works, hence this is some quirk with unicode
# stuff but very likely vim 7.4 BUG too.
if isinstance(_i, UserList) and sys.version_info > (3, ):
_i = [s.encode('utf8').decode('utf8') for s in _i]
MultiPurposeList.__setitem__(self, i, _i)
示例2: __setitem__
# 需要导入模块: from orgmode.liborgmode.documents import MultiPurposeList [as 别名]
# 或者: from orgmode.liborgmode.documents.MultiPurposeList import __setitem__ [as 别名]
def __setitem__(self, i, item):
_i = item
if type(_i) is unicode:
_i = u_encode(item)
# TODO: fix this bug properly, it is really strange that it fails on
# python3 without it. Problem is that when _i = ['* '] it fails in
# UserList.__setitem__() but if it is changed in debuggr in __setitem__
# like item[0] = '* ' it works, hence this is some quirk with unicode
# stuff but very likely vim 7.4 BUG too.
if isinstance(_i, UserList) and sys.version_info > (3, ):
_i = [s.encode('utf8').decode('utf8') for s in _i]
MultiPurposeList.__setitem__(self, i, _i)
示例3: __setitem__
# 需要导入模块: from orgmode.liborgmode.documents import MultiPurposeList [as 别名]
# 或者: from orgmode.liborgmode.documents.MultiPurposeList import __setitem__ [as 别名]
def __setitem__(self, i, item):
_i = item
if type(_i) is unicode:
_i = item.encode(u'utf-8')
MultiPurposeList.__setitem__(self, i, _i)