Q:

Why does Python have both a module and a class called datetime?

I'm constantly getting confused about whether I have imported datetime from datetime, or whether I've just imported datetime.  If I see in some code that datetime is being used, I can't quickly tell whether it is the module datetime or the class datetime.  So annoying.  What can I do?
Also, PEP 8 clearly states: "Class names should normally use the CapWords convention."
It would help if the classes in the datetime module were called DateTime, Date, and Time.
Since this question was put on hold as "unclear what you're asking", I've decided to edit and write more.  To be honest, I wasn't sure what I was asking either -- I just found that I was repeatedly being tripped up by this issue and wanted to get feedback.  I think I did get some very helpful advice, though, especially from tdelaney:

Personally I import datetime as dt and use dt.datetime, etc... because
  I want to keep the original class names while minimizing the confusion
  with the module name.

A:

It might be nice to have more consistent naming. But the standard Python library and what are classically thought of as Python's "built in" types abide neither PEP-8 or any strict model of consistency. All of the standard types (e.g. int, float, str, list, and dict) are lower-case. Some extensions of dict are CapWorded, like OrderedDict. But its companion defaultdict is not. There are a number of data types named the same as their modules, such as array.array and datetime.datetime. The major rewrite of Python 3 moved some modules around, but it didn't homogenize or reorganize the class names to any great degree.
So...just learn to live with it. It's a historical fact, and not likely to change soon.  

