class_mapper doc and code different for 0.5.2

Issue #1316 resolved
Former user created an issue

The API doc for class_mapper say: sqlalchemy.orm.class_mapper(class_, compile=True)

Given a class (or an object), return the primary Mapper associated with the key.

Raises UnmappedClassError if no mapping is configured.

but the code will not take a object.

Older version of class mapper had

    if not isinstance(class_, type):
        class_ = type(class_)

to allow both class or object. Since this code has been changed should the doc be changed to remvoe the (or object) or should the check if statement be put back in the code.

Comments (2)

  1. Log in to comment