Question about the fastai.datapath4file vs pathlib

Hi, I was wondering to know why when I get PosixPath from:

‘’’
from pathlib import Path
xpath = Path(’/content’)
‘’’

Does not have ls() method

but when I get from fastai.datapath4file(’/content’) I have ls() method, for example?

‘’’
xxpath = datapath4file(’/content’)
print(xxpath.ls())
‘’’

both of them are PosixPath type

That’s added on the core.py file of the library:
Path.ls = lambda x: list(x.iterdir())

4 Likes