On Jun 20, 2011, at 2:59 PM, Keith Rome wrote:
> Evaluating a property could potentially introduce unexpected side effects. 
> Best practices in OOP says that a property getter should never alter state, 
> but it happens enough in the wild that I would think it to be dangerous to 
> blindly invoke any getters during an import.
> 
> Also, presence of a property (as opposed to a field) implies that the code in 
> the getter will be invoked each time the property is accessed. A consumer of 
> such a construct expects this behavior, and might even depend on it.
> 
> If the auto import of properties is added, then it needs to at least be an 
> opt-in feature.

We already do this with "from Class import StaticProperty". (from DateTime 
import Now, for example). Making "from StaticClass import *" have the same 
behavior is what we're going for; right now they behave differently. Using 
import-star is already a convenience-only feature, so mucking with it's 
behavior is fair.

_______________________________________________
Ironpython-users mailing list
[email protected]
http://mail.python.org/mailman/listinfo/ironpython-users

Reply via email to