Skip to content

TypeError: unhashable type: 'Level' #7

@adaszko

Description

@adaszko

Hi! I'm getting this exception during the import of lithoxyl:

In [1]: import lithoxyl
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-1-222423bc74ab> in <module>()
----> 1 import lithoxyl

/env/lib/python3.6/site-packages/lithoxyl/__init__.py in <module>()
      3 from lithoxyl.context import get_context, set_context
      4
----> 5 from lithoxyl.logger import Logger, DEBUG, INFO, CRITICAL
      6 from lithoxyl.emitters import StreamEmitter
      7

/env/lib/python3.6/site-packages/lithoxyl/logger.py in <module>()
     15
     16 from lithoxyl.context import get_context
---> 17 from lithoxyl.common import DEBUG, INFO, CRITICAL
     18 from lithoxyl.action import Action, BeginEvent, EndEvent, CommentEvent
     19

/env/lib/python3.6/site-packages/lithoxyl/common.py in <module>()
     65 LEVEL_LIST = []
     66 LEVEL_ALIAS_MAP = {}
---> 67 register_level(MIN_LEVEL)
     68 register_level(MAX_LEVEL)
     69 for level in BUILTIN_LEVELS:

/env/lib/python3.6/site-packages/lithoxyl/common.py in register_level(level_obj)
     59     LEVEL_ALIAS_MAP[level_obj.name.upper()] = level_obj
     60     LEVEL_ALIAS_MAP[level_obj._value] = level_obj
---> 61     LEVEL_ALIAS_MAP[level_obj] = level_obj
     62     LEVEL_LIST[:] = sorted(set(LEVEL_ALIAS_MAP.values()))
     63

TypeError: unhashable type: 'Level'
$ python --version
Python 3.6.4

$ pip freeze | grep lithoxyl
lithoxyl==0.4.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions