本文整理匯總了Python中symbol.sliceop方法的典型用法代碼示例。如果您正苦於以下問題:Python symbol.sliceop方法的具體用法?Python symbol.sliceop怎麽用?Python symbol.sliceop使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類symbol
的用法示例。
在下文中一共展示了symbol.sliceop方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: com_subscriptlist
# 需要導入模塊: import symbol [as 別名]
# 或者: from symbol import sliceop [as 別名]
def com_subscriptlist(self, primary, nodelist, assigning):
# slicing: simple_slicing | extended_slicing
# simple_slicing: primary "[" short_slice "]"
# extended_slicing: primary "[" slice_list "]"
# slice_list: slice_item ("," slice_item)* [","]
# backwards compat slice for '[i:j]'
if len(nodelist) == 2:
sub = nodelist[1]
if (sub[1][0] == token.COLON or \
(len(sub) > 2 and sub[2][0] == token.COLON)) and \
sub[-1][0] != symbol.sliceop:
return self.com_slice(primary, sub, assigning)
subscripts = []
for i in range(1, len(nodelist), 2):
subscripts.append(self.com_subscript(nodelist[i]))
return Subscript(primary, assigning, subscripts,
lineno=extractLineNo(nodelist))
示例2: sliceop
# 需要導入模塊: import symbol [as 別名]
# 或者: from symbol import sliceop [as 別名]
def sliceop(self, nodelist):
raise WalkerError