Skip to content
Snippets Groups Projects

Tonic improvements

Merged Alex Pearce requested to merge apearce-moore-56 into master
All threads resolved!

This MR folds in three commits, each addressing one open issue: #56 (closed), #82 (closed), and #83 (closed).

Warn if a bound function is unused (#56 (closed))

Given this Python:

from PyConf import configurable

@configurable
def func(param=1):
    pass


with func.bind(param=2):
    pass

one gets this warning:

/home/apearce/stack/Moore/PyConf/python/PyConf/tonic.py:162: UserWarning: Bound function <function func at 0x7f4f53081f50> was not called within a bind. Stack trace:
  File "f.py", line 8, in <module>
    with func.bind(param=2):

Switch bind precedence (#82 (closed))

bind calls higher in the call stack now override those lower down. Warnings are now always emitted whenever any precendence conflict is resolved, i.e. when the same parameter is bound to more than one or when it's overriden by at least one bind and at the configurable call site.

All credit to @rmatev for the excellent commit here! :100:

Remove namespace support (#83 (closed))

with namespace(...) is now no longer supported.

Edited by Alex Pearce

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Rosen Matev resolved all threads

    resolved all threads

  • Rosen Matev approved this merge request

    approved this merge request

  • Edited by Software for LHCb
  • Alex Pearce added 2 commits

    added 2 commits

    • 04c1e80b - Fix nested bind precedence, add forced and warnings
    • c156e022 - Remove namespace support.

    Compare with previous version

  • Alex Pearce changed title from Warn if a bound function is unused to Tonic improvements

    changed title from Warn if a bound function is unused to Tonic improvements

  • Alex Pearce changed the description

    changed the description

  • assigned to @rmatev

  • Alex Pearce added 1 commit

    added 1 commit

    Compare with previous version

  • Rosen Matev approved this merge request

    approved this merge request

  • merged

  • Rosen Matev mentioned in commit 9a17ec82

    mentioned in commit 9a17ec82

  • Author Maintainer

    We can delete the rmatev-tonic branch now.

  • Please register or sign in to reply
    Loading