1- ## 0.9.0
1+ # Change Log
2+
3+ ## v0.9.1
4+
5+ - β¬οΈ Upgrade executing to 1.0
6+
7+ ## v0.9.0
28
39- β¬οΈ Upgrade executing to 0.9
410- ποΈ Remove deprecated ` argname2 `
511- β¨ Support constants for ` argname ` even when ` vars_only=True `
612- β¨ Support ` __getattr__/__setattr__ ` etc for ` argname `
713
814 Now you can do:
15+
916 ``` python
1017 from varname import argname
1118
@@ -50,9 +57,11 @@ This is more of a housekeeping release:
5057# # v0.8.2
5158
5259# ## Fixes
60+
5361- π©Ή Use sysconfig instead of distutils.sysconfig to avoid deprecatewarning for python 3.10 +
5462
5563# ## Housekeeping
64+
5665- π· Add python3.10 in CI
5766- π Add license back
5867
@@ -63,13 +72,15 @@ This is more of a housekeeping release:
6372# # v0.8.0
6473
6574Compared to `v0.7.3`
75+
6676- Add `UsingExecWarning` when `exec ` is used to retrieve `func` for `argname()` .
6777- Remove `NonVariableArgumentError` . Use `ImproperUseError` instead.
6878- Add `VarnameError` and `VarnameWarning` as root for varname- related exceptions and warnings, respectively.
6979- Default `strict` to `True ` for `varname()` , `helpers.register()` and `helpers.Wrapper()`
7080- Limit number of context lines for showing where `ImproperUseError` happens
7181
7282Compared to `v0.7.0`
83+
7384- Add `UsingExecWarning` when `exec ` is used to retrieve `func` for `argname()` .
7485- Remove `NonVariableArgumentError` . Use `ImproperUseError` instead.
7586- Add `VarnameError` and `VarnameWarning` as root for varname- related exceptions and warnings, respectively.
@@ -81,38 +92,49 @@ Compared to `v0.7.0`
8192- Limit `VarnameRetrievingError` to the situations only when the AST node is not able to be retrieved.
8293
8394# # v0.7.3
95+
8496- Indicate where the `ImproperUseError` happens for `varname()` (Close # 60)
8597- Add `VarnameException` and `VarnameWarning` as root for all varname- defined exceptions and warnings.
8698
8799# # v0.7.2
100+
88101- Add `strict` mode to `varname()` (# 57)
89102- Support the walrus operator (`:= ` ) (# 58)
90103
91104# # v0.7.1
105+
92106- Add `ignore` argument to `argname2()`
93107- Fix Fix utils.get_argument_sources() when kwargs is given as `** kwargs` .
94108
95109# # v0.7.0
110+
96111- `ImproperUseError` is now independent of `VarnameRetrievingError`
97112- Deprecate `argname` , superseded by `argname2`
113+
98114 ```python
99115 >> > argname(a, b, ... ) # before
100116 >> > argname2(' a' , ' b' , ... ) # after
101117 ```
118+
102119- Add `dispatch` argument to `argname` / `argment2` to be used for single- dispatched functions.
103120
104121# # v0.6.5
122+
105123- Add `sep` argument to `helpers.debug()`
106124
107125# # v0.6.4
126+
108127- Add ImproperUseError to distinguish node retrieving error from improper varname use # 49
109128
110129# # v0.6.3
130+
111131- Fix standard library ignoring ignores 3rd - party libraries under site- packages/
112132- Allow pathlib.Path object to be used in ignore items
113133
114134# # v0.6.2
135+
115136- Remove argument `full` for `nameof` , use `vars_only` instead. When `vars_only=False ` , source of the argument returned.
137+
116138 ```python
117139 # before:
118140 nameof(a.b, full = True ) # 'a.b'
@@ -121,12 +143,16 @@ Compared to `v0.7.0`
121143 nameof(a.b, vars_only = False ) # 'a.b'
122144 nameof(x[0 ], vars_only = False ) # 'x[0]'
123145 ```
146+
124147- Add argument `frame` to `argname` , so that it can be wrapped.
148+
125149 ```python
126150 def argname2(arg, * more_args):
127151 return argname(arg, * more_args, frame = 2 )
128152 ```
153+
129154- Allow `argname` to fetch the source of variable keyword arguments (`** kwargs` ), which will be an empty dict (`{}` ) when no keyword arguments passed.
155+
130156 ```python
131157 def func(a, ** kwargs):
132158 return argname(a, kwargs)
@@ -135,7 +161,9 @@ Compared to `v0.7.0`
135161 # after:
136162 func(x) # returns ('x', {})
137163 ```
164+
138165- Add argument `pos_only` to `argname` to only match the positional arguments
166+
139167 ```python
140168 # before
141169 def func(a, b = 1 ):
@@ -149,7 +177,9 @@ Compared to `v0.7.0`
149177 func(x) # 'x'
150178 func(x, b = 2 ) # 'x'
151179 ```
180+
152181- Parse the arguments only if needed
182+
153183 ```python
154184 # before
155185 def func(a, b):
@@ -159,7 +189,9 @@ Compared to `v0.7.0`
159189 # after
160190 func(x, 1 ) # 'x'
161191 ```
192+
162193- Allow variable positional arguments for `argname` so that `argname(* args)` is allowed
194+
163195 ```python
164196 # before
165197 def func(arg, * args):
@@ -173,90 +205,112 @@ Compared to `v0.7.0`
173205 x = y = 1
174206 func(x, y) # ('x', 'y')
175207 ```
208+
176209- Add `vars_only` (defaults to `False ` ) argument to `helpers.debug` so source of expression becomes available
210+
177211 ```python
178212 a = 1
179213 debug(a+ a) # DEBUG: a+a=2
180214 ```
181215
182216# # v0.6.1
217+
183218- Add `argname` to retrieve argument names/ sources passed to a function
184219
185220# # v0.6.0
221+
186222- Changed:
187- - `Wrapper` , `register` and `debug` moved to `varname.helpers`
188- - Argument `caller` changed to `frame` across all APIs
189- - `ignore` accepting module, filename, function, (function, num_decorators), (module, qualname) and (filename, qualname)
223+ - `Wrapper` , `register` and `debug` moved to `varname.helpers`
224+ - Argument `caller` changed to `frame` across all APIs
225+ - `ignore` accepting module, filename, function, (function, num_decorators), (module, qualname) and (filename, qualname)
190226- Removed:
191- - `inject` (Use `helpers.regiester` instead)
192- - `inject_varname` (Use `helpers.regiester` instead)
193- - `namedtuple`
227+ - `inject` (Use `helpers.regiester` instead)
228+ - `inject_varname` (Use `helpers.regiester` instead)
229+ - `namedtuple`
194230- Added:
195- - Arguments `frame` and `ignore` to `Wrapper`
196- - `helpers.register` as a decorator for functions
231+ - Arguments `frame` and `ignore` to `Wrapper`
232+ - `helpers.register` as a decorator for functions
197233
198234# # v0.5.6
235+
199236- Add `ignore` argument to `varname` to ignore frames that are not counted by caller
200237- Deprecate `inject_varname` , use `register` instead
201238
202239# # v0.5.5
240+
203241- Deprecate inject and use inject_varname decorator instead
204242
205243# # v0.5.4
244+
206245- Allow `varname.varname` to receive multiple variables on the left- hand side
207246
208247# # v0.5.3
248+
209249- Add `debug` function
210250- Deprecate `namedtuple` (will be removed in `0.6 .0` )
211251
212252# # v0.5.2
253+
213254- Move messaging of weird nameof calls from `_bytecode_nameof` to `nameof` .
214255- Disallow `full` to be used when `_bytecode_nameof` needs to be invoked.
215256
216257# # v0.5.1
258+
217259- Add better messaging for weird nameof calls
218260
219261# # v0.5.0
262+
220263- Allow `nameof` to retrieve full name of chained attribute calls
221264- Add `__all__ ` to the module so that only desired APIs are exposed when `from varname import * `
222265- Give more hints on `nameof` being called in a weird way when no soucecode available.
223266
224267# # v0.4.0
268+
225269- Change default of `raise_exc` to `True ` for all related APIs
226270- Deprecate `var_0`
227271- Get rid of `VarnameRetrievingWarning` .
228272
229273# # v0.3.0
274+
230275- Use sys._getframe instead of inspect.stack for efficiency (# 9)
231276- Add alternative way of testing bytecode nameof (# 10)
232277- Drop support for pytest, don' t try to find node when executing fails
233278- Remodel `will` for better logic
234279- Support attributes in varname and nameof (# 14)
235280
236281# # v0.2.0
282+
237283- Fix # 5 and fit nameof in more cases
238284
239285# # v0.1.7
286+
240287- Add `inject` function
241288
242289# # v0.1.6
290+
243291- Fit situations when frames cannot be fetched
244292- Add shortcut for `namedtuple`
245293
246294# # v0.1.5
295+
247296- Fix `will` from a property call
248297
249298# # v0.1.4
299+
250300- Add `will` to detect next immediate attribute name
251301
252302# # v0.1.3
303+
253304- Add arugment `raise_exc` for `varname` to raise an exception instead of returning `var_< index> `
254305
255306# # v0.1.2
307+
256308- Add function `nameof`
257309
258310# # v0.1.1
311+
259312- Add a value wrapper `Wrapper` class
260313
261314# # v0.1.0
315+
262316- Implement `varname` function
0 commit comments