Just trying to help; i am not sure, but what you might also consider is to 
initialise attributes (or on first access) with a default if a default value as 
Column argument is given (i am already doing this in my own code) and also 
reset to this default in case of del, but maybe there are disadvantages.

Cheers, Lars



====================================
Lars van Gemerden
[email protected]
+31 6 26 88 55 39
====================================

On 13 jul. 2013, at 20:02, Michael Bayer <[email protected]> wrote:

> 
> On Jul 13, 2013, at 10:24 AM, Lars van Gemerden <[email protected]> wrote:
> 
>> I think i didn't explain the error enough; just calling del user.name in the 
>> example below causes an exception (except when i already accessed (say print 
>> user.name) the attribute, which seemed odd to me). This is independent of 
>> whether the attr becomes None. 
>> 
>> Otherwise it isn't a real problem in my code, just something i ran into 
>> while cleaning up some internal api, as you say i can easily work around it.
> 
> Great then, yes we don't do a good job with "del" but there is a logic to it 
> which I can't be 100% sure some apps aren't relying upon.    I can possibly 
> make it behave intuitively for 0.9, I guess it should mean, "set the 
> attribute to None" - this because as you might have noticed an instrumented 
> column attribute defaults itself to "None" when first accessed.
> 
> -- 
> You received this message because you are subscribed to a topic in the Google 
> Groups "sqlalchemy" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/sqlalchemy/TRUmFTaDCF8/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to 
> [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/sqlalchemy.
> For more options, visit https://groups.google.com/groups/opt_out.
> 
> 

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to