Skip to content

Commit 57be418

Browse files
committed
fixes #704
1 parent e9caf95 commit 57be418

File tree

2 files changed

+10
-24
lines changed

2 files changed

+10
-24
lines changed

fastcore/basics.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ class AttrDict(dict):
284284
def __getattr__(self,k): return self[k] if k in self else stop(AttributeError(k))
285285
def __setattr__(self, k, v): (self.__setitem__,super().__setattr__)[k[0]=='_'](k,v)
286286
def __dir__(self): return super().__dir__() + list(self.keys())
287-
def _repr_markdown_(self): return f'```json\n{pprint.pformat(self, indent=2)}\n```'
287+
def _repr_markdown_(self): return f'```python\n{pprint.pformat(self, indent=2)}\n```'
288288
def copy(self): return AttrDict(**self)
289289

290290
# %% ../nbs/01_basics.ipynb

nbs/01_basics.ipynb

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -736,12 +736,6 @@
736736
"*Dynamically create a class, optionally inheriting from `sup`, containing `fld_names`*"
737737
],
738738
"text/plain": [
739-
"---\n",
740-
"\n",
741-
"[source](https://github.com/AnswerDotAI/fastcore/blob/main/fastcore/basics.py#L114){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n",
742-
"\n",
743-
"### get_class\n",
744-
"\n",
745739
"> get_class (nm, *fld_names, sup=None, doc=None, funcs=None, anno=None,\n",
746740
"> **flds)\n",
747741
"\n",
@@ -936,12 +930,6 @@
936930
"*Context manager to ignore exceptions*"
937931
],
938932
"text/plain": [
939-
"---\n",
940-
"\n",
941-
"[source](https://github.com/AnswerDotAI/fastcore/blob/main/fastcore/basics.py#L158){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n",
942-
"\n",
943-
"#### ignore_exceptions\n",
944-
"\n",
945933
"> ignore_exceptions ()\n",
946934
"\n",
947935
"*Context manager to ignore exceptions*"
@@ -1105,10 +1093,6 @@
11051093
"*Do nothing*"
11061094
],
11071095
"text/plain": [
1108-
"---\n",
1109-
"\n",
1110-
"### noop\n",
1111-
"\n",
11121096
"> noop (x=None, *args, **kwargs)\n",
11131097
"\n",
11141098
"*Do nothing*"
@@ -1152,10 +1136,6 @@
11521136
"*Do nothing (method)*"
11531137
],
11541138
"text/plain": [
1155-
"---\n",
1156-
"\n",
1157-
"### noops\n",
1158-
"\n",
11591139
"> noops (x=None, *args, **kwargs)\n",
11601140
"\n",
11611141
"*Do nothing (method)*"
@@ -1675,7 +1655,7 @@
16751655
" def __getattr__(self,k): return self[k] if k in self else stop(AttributeError(k))\n",
16761656
" def __setattr__(self, k, v): (self.__setitem__,super().__setattr__)[k[0]=='_'](k,v)\n",
16771657
" def __dir__(self): return super().__dir__() + list(self.keys())\n",
1678-
" def _repr_markdown_(self): return f'```json\\n{pprint.pformat(self, indent=2)}\\n```'\n",
1658+
" def _repr_markdown_(self): return f'```python\\n{pprint.pformat(self, indent=2)}\\n```'\n",
16791659
" def copy(self): return AttrDict(**self)"
16801660
]
16811661
},
@@ -1716,7 +1696,7 @@
17161696
{
17171697
"data": {
17181698
"text/markdown": [
1719-
"```json\n",
1699+
"```python\n",
17201700
"{ 'a': 1,\n",
17211701
" 'b': {'c': 1, 'd': 2},\n",
17221702
" 'c': {'c': 1, 'd': 2},\n",
@@ -7820,7 +7800,13 @@
78207800
"source": []
78217801
}
78227802
],
7823-
"metadata": {},
7803+
"metadata": {
7804+
"kernelspec": {
7805+
"display_name": "python3",
7806+
"language": "python",
7807+
"name": "python3"
7808+
}
7809+
},
78247810
"nbformat": 4,
78257811
"nbformat_minor": 5
78267812
}

0 commit comments

Comments
 (0)