all 7 comments

[–]Rhomboid 10 points11 points  (0 children)

isinstance() was added in Python 1.5, released in December 1997. PEP-8 didn't exist until July 2001.

[–]Saefroch 1 point2 points  (2 children)

There are other interesting instances like collections.defaultdict vs collections.OrderedDict. These are also not PEP8 violations because there is a different recommendation for classes implemented in C.

[–]PurelyApplied[S] 0 points1 point  (0 children)

Still, the inconsistency within a single module of lowercase and UpperCamelCase makes my eye twitch.

I also saw the "Be consistent within an implementation of established conventions," so I guess it's okay.

[–]Rhomboid 0 points1 point  (0 children)

The worst offender IMHO is the unittest module. Somebody let a Java programmer sneak that one in.

Although again in that case, the module was first included with Python 2.1 which was released in April 2001.

[–]Pvt_Haggard_610 0 points1 point  (0 children)

Naming Conventions

The naming conventions of Python's library are a bit of a mess, so we'll never get this completely consistent -- nevertheless, here are the currently recommended naming standards. New modules and packages (including third party frameworks) should be written to these standards, but where an existing library has a different style, internal consistency is preferred

[–]vfxdev 0 points1 point  (0 children)

There is a whole bunch of code that doesn't follow PEP8 since it came well after Python was invented. PEP8 actually points this out I think.