[New-bugs-announce] [issue33190] problem with ABCMeta.__prepare__ when called after types.new_class

Rick Teachey report at bugs.python.org
Fri Mar 30 16:43:02 EDT 2018


New submission from Rick Teachey <ricky at teachey.org>:

I am pretty sure this is a bug. If not I apologize.

Say I want to dynamically create a new `C` class, with base class `MyABC` (and dynamically assigned abstract method `m`). This works fine if I use `type`, but if I use `new_class`, the keyword argument to the `m` method implementation gets lost somewhere in the call to `ABCMeta.__prepare___`.

I've attached a file to demo. Thanks.

----------
components: Library (Lib)
files: abcmeta_prepare.py
messages: 314714
nosy: Ricyteach, levkivskyi
priority: normal
severity: normal
status: open
title: problem with ABCMeta.__prepare__ when called after types.new_class
type: behavior
versions: Python 3.7, Python 3.8
Added file: https://bugs.python.org/file47509/abcmeta_prepare.py

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33190>
_______________________________________


More information about the New-bugs-announce mailing list