Skip to content

Commit 3b974f6

Browse files
committed
augassign
1 parent a33e224 commit 3b974f6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

nbdev/maker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def _filt_dec(x): return decor_id(x).startswith('patch')
8787
def _wants(o): return isinstance(o,_def_types) and not any(L(o.decorator_list).filter(_filt_dec))
8888

8989
# %% ../nbs/api/maker.ipynb 20
90-
def _targets(o): return [o.target] if isinstance(o, ast.AnnAssign) else o.targets
90+
def _targets(o): return [o.target] if isinstance(o, (ast.AugAssign,ast.AnnAssign)) else o.targets
9191

9292
@patch
9393
def make_all(self:ModuleMaker, cells):

nbs/api/maker.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@
279279
"source": [
280280
"#|export\n",
281281
"\n",
282-
"def _targets(o): return [o.target] if isinstance(o, ast.AnnAssign) else o.targets\n",
282+
"def _targets(o): return [o.target] if isinstance(o, (ast.AugAssign,ast.AnnAssign)) else o.targets\n",
283283
"\n",
284284
"@patch\n",
285285
"def make_all(self:ModuleMaker, cells):\n",

0 commit comments

Comments
 (0)