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

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -