desc: >
            Turns a class constructor into an instance of DocString.
            Pass in either Class.__init__, a factory function,
            or factory static method.
        args:
            -   name: ctor
                desc: The constructor method or function to use for
                generating a DocString instance
                type: function-or-method
        raises:
            -   type: AssertionError
                desc: >
                    When ctor does not have a docstring,
                    or when @ctor's docstring does not match @ctor's
                    method signature

def from_ctor(
        ctor,
    ):
        """
        desc: >
            Turns a class constructor into an instance of DocString.
            Pass in either Class.__init__, a factory function,
            or factory static method.
        args:
            -   name: ctor
                desc: The constructor method or function to use for
                generating a DocString instance
                type: function-or-method
        raises:
            -   type: AssertionError
                desc: >
                    When ctor does not have a docstring,
                    or when @ctor's docstring does not match @ctor's
                    method signature
        """
        _docstring = inspect.getdoc(ctor)
        assert _docstring is not None, "No docstring for {}".format(ctor)
        obj = yaml.load(_docstring)
        docstring = unmarshal_json(obj, DocString)
        argspec = getargspec(ctor)
        args, varargs, defaults = (
            argspec.args,
            argspec.varargs,
            argspec.defaults,
        )
        if args[0] == 'self':
            args = args[1:]
        dargs = docstring.args
        assert len(args) == len(dargs), (
            "{}: Mismatched arg counts: \n{}\n{}".format(
                ctor,
                args,
                dargs,
            )
        )
        # Validate that the argument list matches
        for arg1, arg2 in zip(args, dargs):
            assert arg1 == arg2.name, (
                "{}: {} does not match {}".format(
                    ctor,
                    arg1,
                    arg2.name,
                )
            )
        # Validate that the required arguments match
        dreqs = dargs[:-len(defaults)] if defaults else dargs
        for arg in dreqs:
            assert arg.required, (
                "{}: {} should be required: true".format(
                    ctor,
                    arg.name,
                )
            )
        # Validate that the default arguments match
        ddefaults = dargs[-len(defaults):] if defaults else []
        for arg in ddefaults:
            assert not arg.required, (
                "{}: {} should be required: false".format(
                    ctor,
                    arg.name,
                )
            )
        return docstring