Skip to content

Commit 0632ce3

Browse files
dont eval old fastcore cells
1 parent bff2012 commit 0632ce3

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

nbs/fastcore_migration_guide.ipynb

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
"metadata": {},
7171
"outputs": [],
7272
"source": [
73+
"#|eval: false\n",
7374
"from fastcore.dispatch import typedispatch\n",
7475
"\n",
7576
"@typedispatch \n",
@@ -186,6 +187,7 @@
186187
}
187188
],
188189
"source": [
190+
"#|eval: false\n",
189191
"from fastcore.dispatch import TypeDispatch\n",
190192
"t_fc = TypeDispatch(fs)\n",
191193
"t_fc"
@@ -265,6 +267,7 @@
265267
}
266268
],
267269
"source": [
270+
"#|eval: false\n",
268271
"t_fc.add(lambda x: x**2)\n",
269272
"t_fc"
270273
]
@@ -373,6 +376,16 @@
373376
"Before:"
374377
]
375378
},
379+
{
380+
"cell_type": "code",
381+
"execution_count": null,
382+
"id": "ff9599da",
383+
"metadata": {},
384+
"outputs": [],
385+
"source": [
386+
"def f_str(x:str): return x+'1'"
387+
]
388+
},
376389
{
377390
"cell_type": "code",
378391
"execution_count": null,
@@ -399,8 +412,7 @@
399412
}
400413
],
401414
"source": [
402-
"def f_str(x:str): return x+'1'\n",
403-
"\n",
415+
"#|eval: false\n",
404416
"t_fc2 = TypeDispatch(f_str, bases=t_fc)\n",
405417
"t_fc2"
406418
]
@@ -539,6 +551,7 @@
539551
}
540552
],
541553
"source": [
554+
"#|eval: false\n",
542555
"t_fc[int]"
543556
]
544557
},
@@ -559,6 +572,7 @@
559572
"metadata": {},
560573
"outputs": [],
561574
"source": [
575+
"#|eval: false\n",
562576
"t_fc.returns(5)"
563577
]
564578
},
@@ -661,6 +675,7 @@
661675
}
662676
],
663677
"source": [
678+
"#|eval: false\n",
664679
"@typedispatch\n",
665680
"def f2_fc(x:int|float): return x+2\n",
666681
"@typedispatch\n",
@@ -776,6 +791,7 @@
776791
}
777792
],
778793
"source": [
794+
"#|eval: false\n",
779795
"# Before (subclassing required)\n",
780796
"from fastcore.transform import Transform as FCTransform\n",
781797
"\n",

0 commit comments

Comments
 (0)