I concur with Jonathan. Code like this is exactly why attribute inference was introduced in the first place, if I remember correctly.