__init__ takes any argument when mapping a class with no __init__

Issue #908 resolved
Mike Bayer repo owner created an issue
from sqlalchemy import *
from sqlalchemy.orm import *

class Foo(object):
    pass

try:
    x = Foo('foo')
    assert False
except TypeError:
    assert True

m = MetaData()
t =Table('t1', m, Column('id', Integer, primary_key=True))
mapper(Foo, t)
compile_mappers()

try:
    x = Foo('foo')
    assert False
except TypeError:
    assert True

Comments (3)

  1. Log in to comment