manusimidt / py-xbrl

Python-based parser for parsing XBRL and iXBRL files
https://py-xbrl.readthedocs.io/en/latest/
GNU General Public License v3.0
100 stars 37 forks source link

Potential arg bug in transformations __init__ #95

Closed ahoward-ch closed 1 year ago

ahoward-ch commented 1 year ago

My linter caught a potential bug in xbrl.transformations.__init__.py, line 300.

Perhaps I simply dont understand, but I believe it should read

    words: [arg] = value.split(' ')

Currently it reads

    words: [str] = value.split(' ')

I have not posted a PR just in case this is intended behaviour. I still have a lot to learn!

manusimidt commented 1 year ago

I don't really know why it should be [arg] instead of [str]. The python function str.split() should always return an array of strings 🤔

https://docs.python.org/3.3/library/stdtypes.html?highlight=split#str.split

ahoward-ch commented 1 year ago

You are right. I misread the line and thought [str] was a definition rather than a type hint. My linter doesn't recognise type hints and I am not used to seeing them. I had thought you were trying to parse the actual python inbuild method str to an array rather than a variable. My bad!