From 77fefc4e465330cb942595327de249ad9260e97e Mon Sep 17 00:00:00 2001 From: Jeremy Howard Date: Mon, 9 Dec 2024 14:24:28 +1000 Subject: [PATCH] fixes #654 --- fastcore/_modidx.py | 1 + fastcore/basics.py | 12 +++-- fastcore/foundation.py | 2 +- nbs/01_basics.ipynb | 58 ++++++++++++++++++----- nbs/02_foundation.ipynb | 102 ++++++++++++++++++++++------------------ 5 files changed, 112 insertions(+), 63 deletions(-) diff --git a/fastcore/_modidx.py b/fastcore/_modidx.py index 04a9eb32..6e9bd13a 100644 --- a/fastcore/_modidx.py +++ b/fastcore/_modidx.py @@ -90,6 +90,7 @@ 'fastcore.basics._clsmethod': ('basics.html#_clsmethod', 'fastcore/basics.py'), 'fastcore.basics._clsmethod.__get__': ('basics.html#_clsmethod.__get__', 'fastcore/basics.py'), 'fastcore.basics._clsmethod.__init__': ('basics.html#_clsmethod.__init__', 'fastcore/basics.py'), + 'fastcore.basics._conv_key': ('basics.html#_conv_key', 'fastcore/basics.py'), 'fastcore.basics._eval_type': ('basics.html#_eval_type', 'fastcore/basics.py'), 'fastcore.basics._get_op': ('basics.html#_get_op', 'fastcore/basics.py'), 'fastcore.basics._ispy3_10': ('basics.html#_ispy3_10', 'fastcore/basics.py'), diff --git a/fastcore/basics.py b/fastcore/basics.py index 4aa90633..cca2170d 100644 --- a/fastcore/basics.py +++ b/fastcore/basics.py @@ -618,12 +618,16 @@ def range_of(x): return list(range(len(x))) # %% ../nbs/01_basics.ipynb +def _conv_key(k): + if isinstance(k,int): return itemgetter(k) + elif isinstance(k,str): return attrgetter(k) + elif isinstance(k,tuple): return lambda x: tuple(_conv_key(o)(x) for o in k) + return k + def groupby(x, key, val=noop): "Like `itertools.groupby` but doesn't need to be sorted, and isn't lazy, plus some extensions" - if isinstance(key,int): key = itemgetter(key) - elif isinstance(key,str): key = attrgetter(key) - if isinstance(val,int): val = itemgetter(val) - elif isinstance(val,str): val = attrgetter(val) + key = _conv_key(key) + val = _conv_key(val) res = {} for o in x: res.setdefault(key(o), []).append(val(o)) return res diff --git a/fastcore/foundation.py b/fastcore/foundation.py index 9428d0d5..0920e8b9 100644 --- a/fastcore/foundation.py +++ b/fastcore/foundation.py @@ -112,7 +112,7 @@ def __init__(self, items=None, *rest, use_list=False, match=None): def _xtra(self): return None def _new(self, items, *args, **kwargs): return type(self)(items, *args, use_list=None, **kwargs) def __getitem__(self, idx): - if isinstance(idx,int): return self.items[idx] + if isinstance(idx,int) and not hasattr(self.items,'iloc'): return self.items[idx] return self._get(idx) if is_indexer(idx) else L(self._get(idx), use_list=None) def copy(self): return self._new(self.items.copy()) diff --git a/nbs/01_basics.ipynb b/nbs/01_basics.ipynb index 7eeb0a66..3b0631e7 100644 --- a/nbs/01_basics.ipynb +++ b/nbs/01_basics.ipynb @@ -685,7 +685,7 @@ "text/markdown": [ "---\n", "\n", - "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/basics.py#L113){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", + "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/basics.py#L114){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", "\n", "### get_class\n", "\n", @@ -697,7 +697,7 @@ "text/plain": [ "---\n", "\n", - "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/basics.py#L113){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", + "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/basics.py#L114){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", "\n", "### get_class\n", "\n", @@ -875,7 +875,7 @@ "text/markdown": [ "---\n", "\n", - "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/basics.py#L157){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", + "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/basics.py#L158){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", "\n", "#### ignore_exceptions\n", "\n", @@ -886,7 +886,7 @@ "text/plain": [ "---\n", "\n", - "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/basics.py#L157){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", + "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/basics.py#L158){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", "\n", "#### ignore_exceptions\n", "\n", @@ -2910,7 +2910,7 @@ "text/markdown": [ "---\n", "\n", - "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/basics.py#L524){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", + "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/basics.py#L525){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", "\n", "#### GetAttr\n", "\n", @@ -2921,7 +2921,7 @@ "text/plain": [ "---\n", "\n", - "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/basics.py#L524){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", + "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/basics.py#L525){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", "\n", "#### GetAttr\n", "\n", @@ -3601,12 +3601,16 @@ "outputs": [], "source": [ "#|export\n", + "def _conv_key(k):\n", + " if isinstance(k,int): return itemgetter(k)\n", + " elif isinstance(k,str): return attrgetter(k)\n", + " elif isinstance(k,tuple): return lambda x: tuple(_conv_key(o)(x) for o in k)\n", + " return k\n", + "\n", "def groupby(x, key, val=noop):\n", " \"Like `itertools.groupby` but doesn't need to be sorted, and isn't lazy, plus some extensions\"\n", - " if isinstance(key,int): key = itemgetter(key)\n", - " elif isinstance(key,str): key = attrgetter(key)\n", - " if isinstance(val,int): val = itemgetter(val)\n", - " elif isinstance(val,str): val = attrgetter(val)\n", + " key = _conv_key(key)\n", + " val = _conv_key(val)\n", " res = {}\n", " for o in x: res.setdefault(key(o), []).append(val(o))\n", " return res" @@ -3625,7 +3629,39 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "Here's an example of how to *invert* a grouping, using an `int` as `key` (which uses `itemgetter`; passing a `str` will use `attrgetter`), and using a `val` function:" + "You can use an `int` as `key` or `val` (which uses `itemgetter`; passing a `str` will use `attrgetter`), eg:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "test_eq(groupby('aa ab bb'.split(), 0), {'a':['aa','ab'], 'b':['bb']})" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "...and you can use a tuple as `key` or `val` (which creates a tuple from the provided keys or vals), eg:" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "test_eq(groupby('aaa abc bba'.split(), 0, (1,2)), {'a':[('a','a'),('b','c')], 'b':[('b','a')]})" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Here's an example of how to *invert* a grouping, and using a `val` function:" ] }, { diff --git a/nbs/02_foundation.ipynb b/nbs/02_foundation.ipynb index d88a1a5f..6268ce71 100644 --- a/nbs/02_foundation.ipynb +++ b/nbs/02_foundation.ipynb @@ -255,6 +255,14 @@ "execution_count": null, "metadata": {}, "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/Users/jhoward/miniforge3/lib/python3.12/site-packages/tqdm/auto.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html\n", + " from .autonotebook import tqdm as notebook_tqdm\n" + ] + }, { "data": { "text/markdown": [ @@ -551,7 +559,7 @@ " def _xtra(self): return None\n", " def _new(self, items, *args, **kwargs): return type(self)(items, *args, use_list=None, **kwargs)\n", " def __getitem__(self, idx):\n", - " if isinstance(idx,int): return self.items[idx]\n", + " if isinstance(idx,int) and not hasattr(self.items,'iloc'): return self.items[idx]\n", " return self._get(idx) if is_indexer(idx) else L(self._get(idx), use_list=None)\n", " def copy(self): return self._new(self.items.copy())\n", "\n", @@ -1074,7 +1082,7 @@ "text/markdown": [ "---\n", "\n", - "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L124){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", + "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L126){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", "\n", "### L.__setitem__\n", "\n", @@ -1085,7 +1093,7 @@ "text/plain": [ "---\n", "\n", - "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L124){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", + "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L126){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", "\n", "### L.__setitem__\n", "\n", @@ -1125,7 +1133,7 @@ "text/markdown": [ "---\n", "\n", - "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L171){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", + "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L173){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", "\n", "### L.unique\n", "\n", @@ -1136,7 +1144,7 @@ "text/plain": [ "---\n", "\n", - "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L171){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", + "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L173){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", "\n", "### L.unique\n", "\n", @@ -1173,7 +1181,7 @@ "text/markdown": [ "---\n", "\n", - "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L172){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", + "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L174){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", "\n", "### L.val2idx\n", "\n", @@ -1184,7 +1192,7 @@ "text/plain": [ "---\n", "\n", - "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L172){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", + "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L174){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", "\n", "### L.val2idx\n", "\n", @@ -1221,7 +1229,7 @@ "text/markdown": [ "---\n", "\n", - "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L166){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", + "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L168){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", "\n", "### L.filter\n", "\n", @@ -1232,7 +1240,7 @@ "text/plain": [ "---\n", "\n", - "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L166){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", + "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L168){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", "\n", "### L.filter\n", "\n", @@ -1290,7 +1298,7 @@ "text/markdown": [ "---\n", "\n", - "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L162){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", + "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L164){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", "\n", "### L.argwhere\n", "\n", @@ -1301,7 +1309,7 @@ "text/plain": [ "---\n", "\n", - "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L162){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", + "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L164){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", "\n", "### L.argwhere\n", "\n", @@ -1338,7 +1346,7 @@ "text/markdown": [ "---\n", "\n", - "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L163){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", + "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L165){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", "\n", "### L.argfirst\n", "\n", @@ -1349,7 +1357,7 @@ "text/plain": [ "---\n", "\n", - "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L163){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", + "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L165){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", "\n", "### L.argfirst\n", "\n", @@ -1387,7 +1395,7 @@ "text/markdown": [ "---\n", "\n", - "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L161){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", + "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L163){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", "\n", "### L.map\n", "\n", @@ -1398,7 +1406,7 @@ "text/plain": [ "---\n", "\n", - "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L161){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", + "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L163){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", "\n", "### L.map\n", "\n", @@ -1484,7 +1492,7 @@ "text/markdown": [ "---\n", "\n", - "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L175){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", + "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L177){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", "\n", "### L.map_dict\n", "\n", @@ -1495,7 +1503,7 @@ "text/plain": [ "---\n", "\n", - "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L175){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", + "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L177){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", "\n", "### L.map_dict\n", "\n", @@ -1533,7 +1541,7 @@ "text/markdown": [ "---\n", "\n", - "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L187){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", + "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L189){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", "\n", "### L.zip\n", "\n", @@ -1544,7 +1552,7 @@ "text/plain": [ "---\n", "\n", - "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L187){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", + "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L189){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", "\n", "### L.zip\n", "\n", @@ -1593,7 +1601,7 @@ "text/markdown": [ "---\n", "\n", - "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L189){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", + "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L191){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", "\n", "### L.map_zip\n", "\n", @@ -1604,7 +1612,7 @@ "text/plain": [ "---\n", "\n", - "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L189){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", + "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L191){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", "\n", "### L.map_zip\n", "\n", @@ -1642,7 +1650,7 @@ "text/markdown": [ "---\n", "\n", - "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L188){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", + "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L190){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", "\n", "### L.zipwith\n", "\n", @@ -1653,7 +1661,7 @@ "text/plain": [ "---\n", "\n", - "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L188){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", + "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L190){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", "\n", "### L.zipwith\n", "\n", @@ -1692,7 +1700,7 @@ "text/markdown": [ "---\n", "\n", - "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L190){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", + "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L192){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", "\n", "### L.map_zipwith\n", "\n", @@ -1703,7 +1711,7 @@ "text/plain": [ "---\n", "\n", - "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L190){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", + "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L192){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", "\n", "### L.map_zipwith\n", "\n", @@ -1740,7 +1748,7 @@ "text/markdown": [ "---\n", "\n", - "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L179){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", + "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L181){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", "\n", "### L.itemgot\n", "\n", @@ -1751,7 +1759,7 @@ "text/plain": [ "---\n", "\n", - "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L179){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", + "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L181){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", "\n", "### L.itemgot\n", "\n", @@ -1788,7 +1796,7 @@ "text/markdown": [ "---\n", "\n", - "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L183){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", + "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L185){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", "\n", "### L.attrgot\n", "\n", @@ -1799,7 +1807,7 @@ "text/plain": [ "---\n", "\n", - "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L183){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", + "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L185){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", "\n", "### L.attrgot\n", "\n", @@ -1842,7 +1850,7 @@ "text/markdown": [ "---\n", "\n", - "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L139){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", + "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L141){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", "\n", "### L.sorted\n", "\n", @@ -1853,7 +1861,7 @@ "text/plain": [ "---\n", "\n", - "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L139){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", + "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L141){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", "\n", "### L.sorted\n", "\n", @@ -1890,7 +1898,7 @@ "text/markdown": [ "---\n", "\n", - "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L155){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", + "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L157){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", "\n", "### L.split\n", "\n", @@ -1901,7 +1909,7 @@ "text/plain": [ "---\n", "\n", - "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L155){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", + "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L157){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", "\n", "### L.split\n", "\n", @@ -1938,7 +1946,7 @@ "text/markdown": [ "---\n", "\n", - "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L159){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", + "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L161){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", "\n", "### L.range\n", "\n", @@ -1949,7 +1957,7 @@ "text/plain": [ "---\n", "\n", - "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L159){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", + "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L161){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", "\n", "### L.range\n", "\n", @@ -1987,7 +1995,7 @@ "text/markdown": [ "---\n", "\n", - "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L196){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", + "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L198){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", "\n", "### L.concat\n", "\n", @@ -1998,7 +2006,7 @@ "text/plain": [ "---\n", "\n", - "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L196){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", + "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L198){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", "\n", "### L.concat\n", "\n", @@ -2035,7 +2043,7 @@ "text/markdown": [ "---\n", "\n", - "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L115){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", + "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L117){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", "\n", "### L.copy\n", "\n", @@ -2046,7 +2054,7 @@ "text/plain": [ "---\n", "\n", - "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L115){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", + "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L117){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", "\n", "### L.copy\n", "\n", @@ -2084,7 +2092,7 @@ "text/markdown": [ "---\n", "\n", - "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L176){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", + "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L178){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", "\n", "### L.map_first\n", "\n", @@ -2095,7 +2103,7 @@ "text/plain": [ "---\n", "\n", - "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L176){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", + "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L178){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", "\n", "### L.map_first\n", "\n", @@ -2133,7 +2141,7 @@ "text/markdown": [ "---\n", "\n", - "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L200){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", + "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L202){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", "\n", "### L.setattrs\n", "\n", @@ -2144,7 +2152,7 @@ "text/plain": [ "---\n", "\n", - "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L200){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", + "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L202){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", "\n", "### L.setattrs\n", "\n", @@ -2382,7 +2390,7 @@ "text/markdown": [ "---\n", "\n", - "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L281){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", + "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L283){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", "\n", "### Config.get\n", "\n", @@ -2391,7 +2399,7 @@ "text/plain": [ "---\n", "\n", - "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L281){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", + "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L283){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", "\n", "### Config.get\n", "\n", @@ -2476,7 +2484,7 @@ "text/markdown": [ "---\n", "\n", - "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L295){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", + "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L297){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", "\n", "### Config.find\n", "\n", @@ -2487,7 +2495,7 @@ "text/plain": [ "---\n", "\n", - "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L295){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", + "[source](https://github.com/AnswerDotAI/fastcore/blob/master/fastcore/foundation.py#L297){target=\"_blank\" style=\"float:right; font-size:smaller\"}\n", "\n", "### Config.find\n", "\n",