laike9m / pdir2

Pretty dir() printing with joy:beer:
MIT License
1.32k stars 47 forks source link

enum.auto import fails for python < 3.6 #54

Closed Mome closed 3 years ago

Mome commented 3 years ago

Hello,

I just tried to use pdir2 in Python 3.5, it fails to import enum.auto, which was only added in 3.6.

A workaround for me is to replace auto in attr_category.py with a function that returns incrementing integers:

try:
    from enum import auto
except ImportError:
    from itertools import count
    _auto_iter = count()
    auto = lambda : next(_auto_iter)

I dont know if this breaks something.

laike9m commented 3 years ago

This is a bug, but since Python 3.5 has reached the end of life, and people should be using Python >= 3.6, I will not fix it. Still, thanks for the bug report.