Skip to content

Tour of L appears outdated/incorrect #799

@shea-parkes

Description

@shea-parkes

I'm trying to orientate myself to this library. I'm readying the Tour docs here: https://fastcore.fast.ai/tour.html#l

What the docs say should be in the output and what is in the output appears to have diverged:

On this basis, fastcore has just one type that has a single letter name: [L](https://fastcore.fast.ai/foundation.html#l). The reason for this is that it is designed to be a replacement for list, so we want it to be just as easy to use as [1,2,3]. Here’s how to create that as an [L](https://fastcore.fast.ai/foundation.html#l):

L(1,2,3)

[1, 2, 3]
The first thing to notice is that an [L](https://fastcore.fast.ai/foundation.html#l) object includes in its representation its number of elements; that’s the (#3) in the output above. If there’s more than 10 elements, it will automatically truncate the list:

p = L.range(20).shuffle()
p

[14, 19, 13, 11, 8, 9, 0, 6, 4, 15, 1, 17, 16, 5, 3, 10, 2, 7, 12, 18]
[L](https://fastcore.fast.ai/foundation.html#l) contains many of the same indexing ideas that NumPy’s array does, including indexing with a list of indexes, or a boolean mask list:

There is no #3 in the output, nor does the output of p appear truncated to 10 elements.

Here's a screenshot that shows the formatting better:

Image

(I included the text form assuming y'all might try to have an agent work on this...)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions