This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author plokmijnuhby
Recipients eric.smith, plokmijnuhby
Date 2019-09-28.09:19:26
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I've slightly adjusted the script to check for module-level imports not at the top of the file. If we permit things like this:

if condition:
    import module

as long as they are at the top of the file, it seems that only one in ten modules have a problem. Which is better but not great.

A common pattern which breaks the rules is this:

# Large amounts of code here

if __name__ == '__main__':
    import unittest

although that by no means accounts for all of the problems.
Date User Action Args
2019-09-28 09:19:26plokmijnuhbysetrecipients: + plokmijnuhby, eric.smith
2019-09-28 09:19:26plokmijnuhbysetmessageid: <>
2019-09-28 09:19:26plokmijnuhbylinkissue38297 messages
2019-09-28 09:19:26plokmijnuhbycreate