Python 2.7 Backport: enum classes are not instances of abstact enum classes -


i working in pypi enum34 backport of enum class python 2.7.

consider following:

from enum import *  class arttools(enum):     pass  class paintbrushes(arttools):     four_inch_brush = 1     two_inch_brush = 2     fan_brush = 3     paint_knife = 4  print type(paintbrushes.fan_brush) # <enum 'paintbrushes'> assert isinstance(paintbrushes.fan_brush, arttools)  # true/no error  print type(paintbrushes) # <class 'enum.enummeta'> assert isinstance(paintbrushes, arttools) # assertionerror 

is there reason paintbrushes not arttools? seems bug.

paintbrushes class, not instance, therefore won't instance of arttools or other class.


Comments

Popular posts from this blog

Ansible warning on jinja2 braces on when -

Parsing a protocol message from Go by Java -

html - How to custom Bootstrap grid height? -