!21329 add print for example

Merge pull request !21329 from lianliguang/code_docs_primitive
This commit is contained in:
i-robot 2021-08-03 13:26:31 +00:00 committed by Gitee
commit e1a9dccac6
1 changed files with 2 additions and 2 deletions

View File

@ -631,14 +631,14 @@ def constexpr(fn=None, get_instance=True, name=None):
>>> def tuple_len(x):
... return len(x)
...
>>> tuple_len(a)
>>> print(tuple_len(a))
2
>>> # make an operator class to calculate tuple len
>>> @constexpr(get_instance=False, name="TupleLen")
>>> def tuple_len_class(x):
... return len(x)
...
>>> tuple_len_class()(a)
>>> print(tuple_len_class()(a))
2
"""