On Mon, Apr 23, 2012 at 05:48:10AM -0700, Simon King wrote:
...
Our current metaclasses all work by overriding a magical method of
type, or adding a magical method to type. Ideally, this should be in
a customisable way. In some cases, we want to override not just one
method. Currently, each
On Mon, Apr 23, 2012 at 05:59:04AM -0700, Simon King wrote:
In CustomisationMetaclass, it should not be needed to explicitly state
which methods are to be customised. Instead, CustomisationMetaclass
should look if it finds a method named __classbla__ and would
*automatically* customize
Hi Nicolas!
On 2012-04-24, Nicolas M. Thiery nicolas.thi...@u-psud.fr wrote:
On Mon, Apr 23, 2012 at 05:59:04AM -0700, Simon King wrote:
Hence,
class MyClass(Parent):
__metaclass__ = CustomisationMetaclass
@staticmethod
def __classadd__(...
should suffice.
I like
On Tue, Apr 24, 2012 at 07:23:27PM +, Simon King wrote:
OK. But I think priority should be given to cythonization of the existing
metaclasses. Namely, Florent found out how one can produce a cdef'd
metaclasses, so that its instances (thus, usual classes) inherit the fast
methods (like
Hi Nicolas,
On 22 Apr., 00:37, Nicolas M. Thiery nicolas.thi...@u-psud.fr
wrote:
So the question is how many metaclasses we forsee in the future.
Some ideas are below.
NestedClassMetaclass is really a workaround for a mishandling of
nested classes by Python;
Abstractly: What
PS:
On 23 Apr., 14:48, Simon King simon.k...@uni-jena.de wrote:
class MyClass(Parent):
__metaclass__ = CustomisationMetaclass(call,init,add)
...
@staticmethod
def __classadd__(cls, other):
if cls is other:
return cls
return
On Sat, Apr 21, 2012 at 02:41:26PM +, Simon King wrote:
But one could argue that explicit is better than implicit. If we just
see a finite number of applications, then explicitly programming these
finitely many instances may be easier to understand than a general
framework for an infinity
Hi Nicolas,
On 2012-04-21, Nicolas M. Thiery nicolas.thi...@u-psud.fr wrote:
At the same time, it's getting far enough from the KISS principle to
get me uncomfortable. Isn't the use of meta-meta classes overkill (and
thus potentially fragile, if we are not sure of a Python/Cython rock
solid