BLU Discuss list archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Discuss] SQLAlchemy Has Annoyances
- Subject: [Discuss] SQLAlchemy Has Annoyances
- From: smallm at panix.com (Mike Small)
- Date: Thu, 05 Feb 2015 13:45:56 -0500
- In-reply-to: <54D3AF77.2010406@gmail.com> (Richard Pieri's message of "Thu, 05 Feb 2015 12:59:19 -0500")
- References: <54D2B2FA.4000000@borg.org> <54D2C0AC.7060101@gmail.com> <li6r3u49ug8.fsf@panix5.panix.com> <54D3AF77.2010406@gmail.com>
Richard Pieri <richard.pieri at gmail.com> writes: > On 2/5/2015 11:47 AM, Mike Small wrote: >> Does Python's MOP let you add and remove members from classes or are >> they immutable once created? > > If an object (variable, list, class, whatever) isn't a constant then > it is mutable. Scope may restrict what changes are permitted. So in his case could he use only one class and map it to many tables? i.e. when finished with one temporary table and moving on to a second one, could he sweep out all the old class members (member variables or methods -- I don't know how the mapping to columns is done here) and add new ones corresponding to the new set of columns? Would that save this accumulation of useless classes? Or would the old members or a snapshot of the old classes with those members be retained somewhere? Now that I think about it, it's kind of puzzling to remove a method or attribute from a class definition. E.g. if you remove an attribute from the class definition after you've created an instance of that class with a value for that attribute, what kind of object is that object now? Is it still of the type that class represents or is it of the class before your change to its definition was made? Or when you remove the attribute from the class does it find all the instances and release the values bound to that attribute on each one? Or does Python really let you edit a class definition in this way at all? -- Mike Small smallm at panix.com
- Follow-Ups:
- [Discuss] SQLAlchemy Has Annoyances
- From: richard.pieri at gmail.com (Richard Pieri)
- [Discuss] SQLAlchemy Has Annoyances
- From: kentborg at borg.org (Kent Borg)
- [Discuss] SQLAlchemy Has Annoyances
- References:
- [Discuss] SQLAlchemy Has Annoyances
- From: kentborg at borg.org (Kent Borg)
- [Discuss] SQLAlchemy Has Annoyances
- From: richard.pieri at gmail.com (Richard Pieri)
- [Discuss] SQLAlchemy Has Annoyances
- From: smallm at panix.com (Mike Small)
- [Discuss] SQLAlchemy Has Annoyances
- From: richard.pieri at gmail.com (Richard Pieri)
- [Discuss] SQLAlchemy Has Annoyances
- Prev by Date: [Discuss] SQLAlchemy Has Annoyances
- Next by Date: [Discuss] SQLAlchemy Has Annoyances
- Previous by thread: [Discuss] SQLAlchemy Has Annoyances
- Next by thread: [Discuss] SQLAlchemy Has Annoyances
- Index(es):