Choosable dependency

Manfred Lotz ml_news at posteo.de
Mon Mar 8 05:55:09 EST 2021


On Sun, 7 Mar 2021 20:38:30 -0800
Dan Stromberg <drsalists at gmail.com> wrote:

> I sometimes do things like:
> 
> try:
>     import rtoml as toml
> except ImportError:
>     import toml
> 

Also a possibility. Thanks.

> ...but I don't like it very much, because it tends to confuse static
> analyzers like pyflakes and pylint.  Maybe mypy will deal with it
> better? Not sure yet.
> 

Good to know that there could be problems here.

-- 
Manfred



More information about the Python-list mailing list