Closed 0x7162 closed 6 years ago
Could you please describe what are the benefits / issues you're trying to add/resolve? The most popular way how to extract file ext is:
>>> import os
>>> filename, file_extension = os.path.splitext('/path/to/somefile.ext')
>>> filename
'/path/to/somefile'
>>> file_extension
'.ext'
From stackoverflow.
The only benefit here is readability based on fact you are not using this extension to access any file. It is really minor issue - you can drop it easily :-)
Could you please update your PR with unittests / solve conflicts to get this issue resolved?
Closing due to no activity, feel free to reopen.
Minor: I suppose period prefix could be removed from data structure
i.e.
It makes no sense to keep period prefix as you are not using this field other than as
key
for value It will improve readability and save 1 char for each extension :-)https://github.com/belyalov/tinyweb/blob/4ea409cf004b6b684b452af486cbc8f4bd77ee80/tinyweb/static.py#L9-L19