nucleic/atom — pull request #19 by blink1073 (2013-10-26 13:54:19+00:00)
Title: Enforce Member Behavior in Metaclass

I noticed I had made three logical errors when trying Atom (I should have remembered the second from Traits).

- Not instantiating a Member

```python
class Test(Atom):
b = Bool
```

- Using sub-Atoms without them being Instance() or Type()

```python
class Sub(Atom):
pass

class Main(Atom):
sub = Sub()
```

- Not instantiating sub-Atoms (needed to be handled separately).

```python
class Sub(Atom):
pass

class Main(Atom):
sub = Sub
```

This PR will raise all three errors and provide a helpful message to the user.

What is missing is handling if the user has an Atom member of any other type (such as `sub = 1` or `fig = Figure`).
Should those raise an error too? If so, I will add the following:

```
elif cls.__name__ != 'Atom':
if not key in ['__slots__', '__module__']:
msg = 'In class "{}.{}": Atom members must be of type'
msg += ' atom.Member'
raise TypeError(msg.format(cls.__name__, key))
```