Always define a module once. Do not import the module multiple times and/or import the module using different methods. It makes the code harder to understand. Import a module once and for all with only one import mechanism.
Non-Compliant Code Examples
importloggingimportlogging# do not import the same module again.
Compliant Code Examples
importtypingfromtypingimportcast
importlogging
importloggingfromloggingimportfoo# not an issue since we are using a from import
シームレスな統合。 Datadog Code Security をお試しください
Datadog Code Security
このルールを試し、Datadog Code Security でコードを解析する
このルールの使用方法
1
2
rulesets:- python-best-practices # Rules to enforce Python best practices.