你好,老师,
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,不知这两个如何解释,如何定义?
谢谢!