nucleic/atom — pull request #45 by MatthieuDartiailh (2013-11-12 21:11:36+00:00)
Title: Add a type member

This PR adds a Type member similar to the Type Traits. It accepts as value the class given as argument or any subclass, it cannot be set to None and does not have a default value. The validate method is implemented using PyObject_IsSubclass in c++. No ForwardType member is provided.
I think that Member would prove useful, and I have actually two user cases :
- when declaring a Dict to be used with a Mapped view it can make the code more readable by specifying what kind of classes are expected to be visualized.
- when the user can create a new instance from a list of possible values, it is convenient to store the possible classes in a list. By marking that list as expecting subclasses of a specific class the code can be easier to read.