- assigned issue to
proposal: replace decoration functions with decorate module
The attached patch replaces all the eval/argspec stuff in util with the usage of the decorator
module. This would add a dependency to SQLAlchemy's install, but the patch has a net code reduction of 350 lines (including some cleanup and removal of some other dead functions in util).
Comments (12)
-
reporter -
-1 for now. the stuff decorator stuff that's in there is small and well tested. i'd like to revisit later, when other non-dbapi dependencies are in play.
there's a bunch of unrelated stuff in that patch that looks fine.
-
reporter is the concern that the decorators module is not as well tested as our homegrown code or that its not worth having a single dependency ? One advantage to going to 'decorators' now is that we don't move further away from migrating to it later. Another is that the current code does the "string eval" thing in three places and it would be a lot cleaner if it were only in one. In that sense, our own util.decorators could be used the same way
decorators
is used in this patch...which would be my next proposal. -
reporter i mean,
util.decorator(target)
. -
the stuff in util and attributes is tightly tuned to what we're doing + a little more capable than
decorators
. using it for init (e.g.) adds a chunk of overhead. -
reporter a18035cfb16d8b55e460a9f3752c3b9f697e7729 commits all the cleanup, including some sneaked in
accepts_a_list_as_starargs
, but retains the currentdecorator
function, dependencies, and attributes decoration approach. -
reporter we may have a more fully featured decorator module for use, as described in http://www.artima.com/forums/flat.jsp?forum=106&thread=265857&start=0&msRange=15 . Reconsider this for 0.6.
-
Account Deleted Meta-question: How do I add my email address to the CC-list of this bug?
-
reporter Replying to guest:
Meta-question: How do I add my email address to the CC-list of this bug?
if theres no "Cc:" edit field for you, just send me your email address to mike_mp at zzzcomputing.com . or point me to where I have trac misconfigured since this is an annoying issue.
-
reporter - changed milestone to 0.6.xx
took a look at the newly publicized
FunctionMaker
interface and didn't see a huge win on that. this would be used in theory for the__init__
decoration. its not occurring to me how usingFunctionMaker
directly would be better than the usage of@decorator
I have in the patch - it seems complicated and doesn't save me the need to call inspect.getargspec() and similar, if I'm going to render the code as a string. whereas using decorator I don't have to deal with strings at all. -
reporter - changed milestone to blue sky
-
reporter - changed status to wontfix
no need to keep this open
- Log in to comment
assigning to jek for the +1/-1 vote