请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

slot wrapper 和 attribute 怎么解释

你好,老师,
print(re.Match.dict)的打印如下:
{‘repr’: <slot wrapper ‘repr’ of ‘re.Match’ objects>, ‘getitem’: <slot wrapper ‘getitem’ of ‘re.Match’ objects>, ‘group’: <method ‘group’ of ‘re.Match’ objects>, ‘start’: <method ‘start’ of ‘re.Match’ objects>, ‘end’: <method ‘end’ of ‘re.Match’ objects>, ‘span’: <method ‘span’ of ‘re.Match’ objects>, ‘groups’: <method ‘groups’ of ‘re.Match’ objects>, ‘groupdict’: <method ‘groupdict’ of ‘re.Match’ objects>, ‘expand’: <method ‘expand’ of ‘re.Match’ objects>, ‘copy’: <method ‘copy’ of ‘re.Match’ objects>, ‘deepcopy’: <method ‘deepcopy’ of ‘re.Match’ objects>, ‘string’: <member ‘string’ of ‘re.Match’ objects>, ‘re’: <member ‘re’ of ‘re.Match’ objects>, ‘pos’: <member ‘pos’ of
’re.Match’ objects>, ‘endpos’: <member ‘endpos’ of ‘re.Match’ objects>, ‘lastindex’: <attribute ‘lastindex’ of ‘re.Match’ objects>, ‘lastgroup’: <attribute ‘lastgroup’ of ‘re.Match’ objects>, ‘regs’: <attribute ‘regs’ of ‘re.Match’ objects>, ‘doc’: ‘The result of re.match() and re.search().\nMatch objects always have a boolean value of True.’}

老师已经讲过类的member和method,但没讲过slot wrapper和attribute,不知这两个如何解释,如何定义?

谢谢!

正在回答 回答被采纳积分+3

1回答

7七月 2019-12-01 13:51:30

slot这个基本用不到,但确实是python里的语法。可以搜索下slot,这比我在这打字要好很多。attribute不知道啥意思?

0 回复 有任何疑惑可以回复我~
问题已解决,确定采纳
还有疑问,暂不采纳
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号