Skip to content

Commit 81a1373

Browse files
authored
0.6.5 (#52)
* Add `sep` argument to `helpers.debug()` * 0.6.5
1 parent 218cbf0 commit 81a1373

File tree

5 files changed

+9
-4
lines changed

5 files changed

+9
-4
lines changed

docs/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## v0.6.5
2+
- Add `sep` argument to `helpers.debug()`
3+
14
## v0.6.4
25
- Add ImproperUseError to distinguish node retrieving error from improper varname use #49
36

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "poetry.masonry.api"
44

55
[tool.poetry]
66
name = "varname"
7-
version = "0.6.4"
7+
version = "0.6.5"
88
description = "Dark magics about variable names in python."
99
authors = [ "pwwang <pwwang@pwwang.com>",]
1010
license = "MIT"

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
setup(
2525
long_description=readme,
2626
name='varname',
27-
version='0.6.4',
27+
version='0.6.5',
2828
description='Dark magics about variable names in python.',
2929
python_requires='==3.*,>=3.6.0',
3030
project_urls={"homepage": "https://github.com/pwwang/python-varname",

varname/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@
1111
)
1212
from .core import varname, nameof, will, argname
1313

14-
__version__ = "0.6.4"
14+
__version__ = "0.6.5"

varname/helpers.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ def debug(var, *more_vars,
130130
prefix: str = 'DEBUG: ',
131131
merge: bool = False,
132132
repr: bool = True, # pylint: disable=redefined-builtin
133+
sep: str = '=',
133134
vars_only: bool = False) -> None:
134135
"""Print variable names and values.
135136
@@ -148,6 +149,7 @@ def debug(var, *more_vars,
148149
*more_vars: Other variables to print
149150
prefix: A prefix to print for each line
150151
merge: Whether merge all variables in one line or not
152+
sep: The separator between the variable name and value
151153
repr: Print the value as `repr(var)`? otherwise `str(var)`
152154
"""
153155
var_names = argname(
@@ -161,7 +163,7 @@ def debug(var, *more_vars,
161163

162164
values = (var, *more_vars)
163165
name_and_values = [
164-
f"{var_name}={value!r}" if repr else f"{var_name}={value}"
166+
f"{var_name}{sep}{value!r}" if repr else f"{var_name}{sep}{value}"
165167
for var_name, value in zip(var_names, values)
166168
]
167169

0 commit comments

Comments
 (0)