Open bswck opened 1 week ago
Hi @bswck and thanks for all the insights. Please take a look at my answers to yours comments:
OrderedDict
will be removed in a near future when I will rewrite a whole blog plugin. The code base there is from a very early days of this entire repo when I was more learning how MkDocs works internally and it needs to be changed to allow for some other things to be added.OrderedDict
will be removed in a near future when I will rewrite a whole blog plugin. The code base there is from a very early days of this entire repo when I was more learning how MkDocs works internally and it needs to be changed to allow for some other things to be added.typing.TYPE_CHECKING
wasn't aware of that trick, but it seems like this is only use full when you try to avoid circular references. In other cases id don't see benefits especially in context of using isort
for imports sorting. What are other drawback of importing something just for type hinting?cast
, in most cases it's needed and used in config.py
files when using option.SubConfig
, so the proper type is preserved and pyright
doesn't complain. I agree that in those files it can be removed. In other places, depends on the code context.resources.py
and in some old blog files that will be rewritten (see point 1). Is there any other places? Files in dev
that are more or less concepts and are never used by the plugin code?Any way, thanks for all suggestions and I will definitely use most of them. If you can also elaborate a little bit more about point 5 and 6, it will helps a lot for me to better understand what and why is wrong.
Feature description
Some general thoughts after flicking through the codebase, gathered in a "to-do":
OrderedDict
which was superseded bydict
in 3.7 (technically 3.6) unless forpopitem
/move_to_end
, stop using deprecated typing aliases)typing.TYPE_CHECKING
for types-only importingimportlib.resources
in so many placesI can contribute to some of these when I find time, as well as find other rooms for improvement. Thanks for extending the capabilities of MkDocs!
Link
No response
Contact details
bartoszpiotrslawecki@gmail.com