Skip to content

Commit f207677

Browse files
committed
fix: Config.get returns False for missing bool keys
1 parent 77627c5 commit f207677

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

fastcore/foundation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,9 +271,9 @@ def __getitem__(self,k): return stop(IndexError(k)) if k not in self.d else se
271271

272272
def get(self,k,default=None):
273273
v = self.d.get(k, default)
274+
if v is None: return None
274275
typ = self.types.get(k, None)
275276
if typ==bool: return str2bool(v)
276-
if v is None: return None
277277
if not typ: return str(v)
278278
if typ==Path: return self.config_path/v
279279
return typ(v)

nbs/02_foundation.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2280,9 +2280,9 @@
22802280
"\n",
22812281
" def get(self,k,default=None):\n",
22822282
" v = self.d.get(k, default)\n",
2283+
" if v is None: return None\n",
22832284
" typ = self.types.get(k, None)\n",
22842285
" if typ==bool: return str2bool(v)\n",
2285-
" if v is None: return None\n",
22862286
" if not typ: return str(v)\n",
22872287
" if typ==Path: return self.config_path/v\n",
22882288
" return typ(v)\n",

0 commit comments

Comments
 (0)