From 0d5f991c2ebf52d8130549381c15202cdacab546 Mon Sep 17 00:00:00 2001 From: Martin Teichmann Date: Sun, 17 Jul 2016 13:23:59 +0200 Subject: [PATCH] add backwards compatibility comment --- pep-0487.txt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pep-0487.txt b/pep-0487.txt index 56318627f..e360852cd 100644 --- a/pep-0487.txt +++ b/pep-0487.txt @@ -350,6 +350,20 @@ if keyword arguments are given:: Defining both ``__init__`` and ``__new__`` continues to work fine. +About the only thing that stops working is passing the arguments of +``type.__new__`` as keyword arguments:: + + class MyMeta(type): + def __new__(cls, name, bases, namespace): + return super().__new__(cls, name=name, bases=bases, + dict=namespace) + + class MyClass(metaclass=MyMeta): + pass + +This will now raise ``TypeError``, but this is weird code, and easy +to fix even if someone used this feature. + Rejected Design Options =======================