Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #49382

Re: Problems with subclassing enum34

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.018
X-Spam-Evidence '*H*': 0.96; '*S*': 0.00; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'thus,': 0.09; 'bug': 0.12; 'enum': 0.16; 'kern': 0.16; 'metaclasses': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'subject:Problems': 0.16; 'underlying': 0.16; 'wrote:': 0.18; 'solution.': 0.20; '>>>': 0.22; 'header:User-Agent:1': 0.23; 'interpret': 0.24; 'mention': 0.26; 'skip:_ 20': 0.27; 'gets': 0.27; 'header:X-Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'forgot': 0.30; 'robert': 0.30; "i'm": 0.30; 'work.': 0.31; 'ctypes': 0.31; 'problem': 0.35; 'subject:with': 0.35; 'but': 0.35; 'there': 0.35; "didn't": 0.36; 'two': 0.37; 'to:addr:python-list': 0.38; 'skip:_ 30': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'manually': 0.60; 'simply': 0.61; 'our': 0.64; 'chance': 0.65; 'thomas': 0.65; 'world': 0.66; 'between': 0.67; 'believe': 0.68; 'eco': 0.84; 'terrible': 0.84
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Robert Kern <robert.kern@gmail.com>
Subject Re: Problems with subclassing enum34
Date Fri, 28 Jun 2013 17:17:40 +0100
References <b357q6Fql37U1@mid.individual.net> <mailman.3961.1372432574.3114.python-list@python.org> <b35o16Fu6l8U1@mid.individual.net> <b35odpFu8igU1@mid.individual.net>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding 7bit
X-Gmane-NNTP-Posting-Host 213.1.240.226
User-Agent Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20130620 Thunderbird/17.0.7
In-Reply-To <b35odpFu8igU1@mid.individual.net>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.3964.1372436274.3114.python-list@python.org> (permalink)
Lines 28
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1372436274 news.xs4all.nl 15964 [2001:888:2000:d::a6]:56667
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:49382

Show key headers only | View raw


On 2013-06-28 16:32, Thomas Heller wrote:
> Am 28.06.2013 17:25, schrieb Thomas Heller:
>> Robert Kern:
>>
>>>
>>> enum.EnumMeta uses super() in its __new__() implementation but
>>> _ctypes.PyCSimpleType doesn't. Thus, only
>>> _ctypes.PyCSimpleType.__new__() gets a chance to run. Switching the
>>> order of the two might work.
>>>
>>
>> Robert found the problem but I'm unsure if there is a solution.
>> Also I'm unsure whether this is a bug in ctypes or in enum or if
>> they are simply incompatible.
>
> I forgot to mention that switching the order of metaclasses didn't work.

You may also need to manually deal with the conflict between Enum.__new__() and 
c_int.__new__().

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
  that is made terrible by our own mad attempt to interpret it as though it had
  an underlying truth."
   -- Umberto Eco

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Problems with subclassing enum34 Thomas Heller <theller@ctypes.org> - 2013-06-28 12:48 +0200
  Re: Problems with subclassing enum34 Robert Kern <robert.kern@gmail.com> - 2013-06-28 12:16 +0100
  Re: Problems with subclassing enum34 88888 Dihedral <dihedral88888@gmail.com> - 2013-06-28 04:52 -0700
  Re: Problems with subclassing enum34 Ethan Furman <ethan@stoneleaf.us> - 2013-06-28 08:16 -0700
    Re: Problems with subclassing enum34 Thomas Heller <theller@ctypes.org> - 2013-06-28 17:25 +0200
      Re: Problems with subclassing enum34 Thomas Heller <theller@ctypes.org> - 2013-06-28 17:32 +0200
        Re: Problems with subclassing enum34 Robert Kern <robert.kern@gmail.com> - 2013-06-28 17:17 +0100
        Re: Problems with subclassing enum34 Ethan Furman <ethan@stoneleaf.us> - 2013-06-28 10:09 -0700

csiph-web