Skip to content

Commit a149ab3

Browse files
authored
0.6.3 (#47)
* Add ignore_stdlib in config * Fix playground * Fix playground * Default ignore_stdlib to False * Update docs * 0.6.3 * Fix #46
1 parent e63db96 commit a149ab3

File tree

11 files changed

+239
-179
lines changed

11 files changed

+239
-179
lines changed

.pylintrc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,8 @@ disable=print-statement,
156156
too-many-return-statements,
157157
too-many-locals,
158158
not-callable,
159-
unsubscriptable-object
159+
unsubscriptable-object,
160+
unused-arguments
160161

161162
# Enable the message, report, category or checker with the given id(s). You can
162163
# either give multiple identifier separated by comma (,) or put this option
@@ -225,7 +226,7 @@ ignore-docstrings=yes
225226
ignore-imports=yes
226227

227228
# Minimum lines number of a similarity.
228-
min-similarity-lines=4
229+
min-similarity-lines=10
229230

230231

231232
[SPELLING]

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,10 +226,10 @@ nameof(f) # 'f'
226226

227227
# get full names of (chained) attribute calls
228228
func.a = func
229-
nameof(func.a, full=True) # 'func.a'
229+
nameof(func.a, vars_only=False) # 'func.a'
230230

231231
func.a.b = 1
232-
nameof(func.a.b, full=True) # 'func.a.b'
232+
nameof(func.a.b, vars_only=False) # 'func.a.b'
233233
```
234234

235235
### Detecting next immediate attribute name

README.rst

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,11 @@ Retrieving the variable names using ``varname(...)``
155155
156156
func = asyncio.run(function()) # func == 'func'
157157
158+
# you can switch it off by:
159+
# config.ignore_stdlib = False
160+
# then you have to specify the library yourself:
161+
# varname(ignore=[asyncio])
162+
158163
*
159164
Retrieving name of a class instance
160165

@@ -292,10 +297,10 @@ Getting variable names directly using ``nameof``
292297
293298
# get full names of (chained) attribute calls
294299
func.a = func
295-
nameof(func.a, full=True) # 'func.a'
300+
nameof(func.a, vars_only=False) # 'func.a'
296301
297302
func.a.b = 1
298-
nameof(func.a.b, full=True) # 'func.a.b'
303+
nameof(func.a.b, vars_only=False) # 'func.a.b'
299304
300305
Detecting next immediate attribute name
301306
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -389,7 +394,9 @@ Debugging with ``debug``
389394
# DEBUG: a='value', b=<object object at 0x2b70580e5f20>
390395
debug(a, repr=False, prefix='') # a=value
391396
# also debug an expression
392-
debug(a+a, vars_only=False) # DEBUG: a+a='valuevalue'
397+
debug(a+a) # DEBUG: a+a='valuevalue'
398+
# If you want to disable it:
399+
debug(a+a, vars_only=True) # error
393400
394401
Reliability and limitations
395402
---------------------------
@@ -411,11 +418,8 @@ For example:
411418
.. code-block:: python
412419
413420
a = 1
414-
assert nameof(a) == 'a'
421+
assert nameof(a) == 'a' # pytest manipulated the ast here
415422
416423
# do this instead
417424
name_a = nameof(a)
418425
assert name_a == 'a'
419-
420-
*
421-
``R`` with ``reticulate``.

docs/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## v0.6.3
2+
- Fix standard library ignoring ignores 3rd-party libraries under site-packages/
3+
14
## v0.6.2
25
- Remove argument `full` for `nameof`, use `vars_only` instead. When `vars_only=False`, source of the argument returned.
36
```python

0 commit comments

Comments
 (0)