My use case it the following:
We have some additional magic that we want to always use in our project.
So one idea would be to create an instance of Magic with the appropriate magic_file.
But now when we want to specify mime=True or follow_symlinks=True we need to create a new instance of Magic.
I guess one could say that all other arguments than magic_file are of a more short-lived nature.
This leads to some boilerplate which I think belongs in python-magic instead.
My proposal would be to add some way to set a default value for magic_file.
While I know that this is the way libmagic is designed I think we can to better in a wrapper library.
My use case it the following: We have some additional magic that we want to always use in our project. So one idea would be to create an instance of
Magic
with the appropriatemagic_file
. But now when we want to specifymime=True
orfollow_symlinks=True
we need to create a new instance ofMagic
. I guess one could say that all other arguments thanmagic_file
are of a more short-lived nature.This leads to some boilerplate which I think belongs in python-magic instead.
My proposal would be to add some way to set a default value for
magic_file
. While I know that this is the way libmagic is designed I think we can to better in a wrapper library.Related:
304
https://github.com/fkie-cad/FACT_core/pull/1140