jaberg / pyll

3 stars 5 forks source link

reloading python modules #6

Open yamins81 opened 12 years ago

yamins81 commented 12 years ago

currently pyll does not play well with reload python modules ... you get lots of 'Cannot override existing symbol' errors

can this be improved?

jaberg commented 12 years ago

If you're going to reload modules, you are in effect redefining things in exactly the way that this mechanism was supposed to prevent. But you're doing it on purpose. I propose a scope attribute that enables and disables this check. So you can do something like

scope.allow_redefinitions()

scope.disable_redefinitions() or even more pythonically: with scope.allowing_redefinitions(): On Fri, Feb 17, 2012 at 12:07 PM, Dan Yamins < reply@reply.github.com > wrote: > > currently pyll does not play well with reload python modules ... you get > lots of 'Cannot override existing symbol' errors > > can this be improved? > > --- > > Reply to this email directly or view it on GitHub: > https://github.com/jaberg/pyll/issues/6
yamins81 commented 12 years ago

Seems reasonable to me ... but why was this mechanism explicitly meant to prevent redefinition in the first place? ... scratch that question, I get it.