I'm having tough time understanding def list_entries function . what does _, mean? and inside sorted() there is a regex expr which means replace .md with empty string and then it runs a for loop? it's possible to run a for loop in sorted after regex expression? and lastly if statement checking if it file ends with .md?
I just want to know how this is all put together into sorted()
Thank you for your help.
import re
from django.core.files.base import ContentFile
from django.core.files.storage import default_storage
def list_entries():
_, filenames = default_storage.listdir("entries")
return list(sorted(re.sub(r"\.md$", "", filename)for filename in filenames if filename.endswith(".md")))