8000 update and correct documentation of nameof (#70) · pwwang/python-varname@2ebc654 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2ebc654

Browse files
update and correct documentation of nameof (#70)
1 parent d5eade2 commit 2ebc654

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

varname/core.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ def nameof(
233233
234234
>>> x = lambda: None
235235
>>> x.y = 1
236-
>>> nameof(x.y, full=True) # 'x.y'
236+
>>> nameof(x.y, vars_only=False) # 'x.y'
237237
238238
Note:
239239
This function works with the environments where source code is
@@ -252,7 +252,7 @@ def nameof(
252252
Note that the calls from standard libraries are ignored.
253253
Also note that the wrapper has to have signature as this one.
254254
vars_only: Whether only allow variables/attributes as arguments or
255-
any expressions. If `True`, then the sources of the arguments
255+
any expressions. If `False`, then the sources of the arguments
256256
will be returned.
257257
258258
Returns:
@@ -261,7 +261,7 @@ def nameof(
261261
If multiple variables are passed, return a tuple of their
262262
names/sources.
263263
If the argument is an attribute (e.g. `a.b`) and `vars_only` is
264-
`False`, only `"b"` will returned. Set `vars_only` to `True` to
264+
`True`, only `"b"` will returned. Set `vars_only` to `False` to
265265
get `"a.b"`.
266266
267267
Raises:

0 commit comments

Comments
 (0)
0