Michael Bayer wrote:
> __repr__() really annoys me because no matter what i do with it, people
> tell me im using it incorrectly.  technically, __repr__() is supposed
> to return a string that when eval'ed would return the object instance.
> which is not realistic for an object like Table since its an enormous
> construction.
>
> if you want to take Tables and produce some kind of string
> representation, I recommend you create yourself a SchemaVisitor...since
> __repr__() is not something id write code against in this case.

Thanks. In my limited case the __repr__ is close enough to treat it as
a string for post-processing. All I need is to replace the field type
instance with the proper constructor. These are one-off operations in
order to commit a matching sqlalchemy model for existing versioned DDL
to the repository.

Would it be useful to add __repr__() roundtripping as long-term trac
ticket?

Acknowledging that full general-case __repr__ may be impractical, if
anyone saw the ticket and had ideas for incremental improvements,
__repr__ would seem to be amenable to test cases, documented
limitations, etc.


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to