# Class naming Convention (date class)

```python
from datetime import date

my_date = date(year, month, day)

print(my_date.year) 
print(my_date.month) 
print(my_date.day)
print(my_date.weekday())
```

I thought classes begins with a capital letter

According to the Python naming conventions, class names typically begin with a capital letter.

To clarify, the class in the datetime module is indeed called date (with a lowercase "d"). Despite not following the standard naming convention, it is an exception due to historical reasons.

**other exceptions like date**

There are a few other exceptions in Python where class names do not strictly follow the convention of starting with a capital letter. These exceptions are usually historical artifacts or design choices made for compatibility reasons. Here are a couple of notable examples:

1. `Counter` and `deque` in the `collections` module:
    
    ```python
    from collections import Counter, deque
    
    my_counter = Counter()
    my_deque = deque()
    ```
    
2. `defaultdict` in the `collections` module:
    
    ```python
    from collections import defaultdict
    
    my_dict = defaultdict(int)
    ```
    
3. `namedtuple` in the `collections` module:
    
    ```python
    from collections import namedtuple
    
    Point = namedtuple('Point', ['x', 'y'])
    p = Point(1, 2)
    ```
    
4. `OrderedDict` in the `collections` module:
    
    ```python
    from collections import OrderedDict
    
    my_dict = OrderedDict()
    ```
    

These exceptions are generally accepted because they have been part of the Python standard library for a long time, and changing their names could potentially break existing code. However, it's important to note that these exceptions are relatively rare, and most classes in Python follow the convention of starting with a capital letter for class names.

It's important to note that while Python has established naming conventions, there are occasional exceptions and inconsistencies due to historical reasons, backward compatibility, or design choices made by the library or module developers. These exceptions may not always have a clear historical or technical justification.

However, it is generally recommended to follow the Python naming conventions, which state that class names should begin with a capital letter. Consistent naming conventions make code more readable and maintainable, and they align with the common practices observed in the Python community.
