mysql MSFloat fail to be "repr"

Issue #775 resolved
Former user created an issue

How to reproduce

from sqlalchemy.databases.mysql import MSFloat f = MSFloat() repr(f) Traceback (most recent call last): File "<stdin>", line 1, in ? File "/usr/lib/python2.4/types.py", line 124, in repr

AttributeError: 'MSFloat' object has no attribute 'length'


This seems to be related to mysql.MSFloat taking an optional 'length' argument, and setting (or not) an attribute.

I see two way of solving the issue : - overload repr in MSFloat - always set the length attribute (I prefer this one, see attached patch)

Comments (3)

  1. Former user Account Deleted

    I forgot to format the source code in the description :

    from sqlalchemy.databases.mysql import MSFloat
    f = MSFloat()
    repr(f)
    

    Leads to :

    Traceback (most recent call last):
      File "<stdin>", line 1, in ?
      File "/usr/lib/python2.4/types.py", line 124, in __repr__
    
    AttributeError: 'MSFloat' object has no attribute 'length'
    
  2. Log in to comment