Merge lp://staging/~wallyworld/storm/support-recursive-with into lp://staging/~launchpad-committers/storm/lp

Proposed by Ian Booth
Status: Approved
Approved by: Ian Booth
Approved revision: 399
Proposed branch: lp://staging/~wallyworld/storm/support-recursive-with
Merge into: lp://staging/~launchpad-committers/storm/lp
Diff against target: 66 lines (+25/-3)
3 files modified
NEWS (+1/-0)
storm/expr.py (+10/-3)
tests/expr.py (+14/-0)
To merge this branch: bzr merge lp://staging/~wallyworld/storm/support-recursive-with
Reviewer Review Type Date Requested Status
Free Ekanayaka (community) Approve
Launchpad Committers Pending
Review via email: mp+74327@code.staging.launchpad.net

Commit message

Extend WITH expression to support recursion.

Description of the change

This branch extends with WITH expression to support recursion.

== Implementation ==

Add a new recursive attribute to With and change it's compiler to support it.

== Tests ==

There were no tests for With so I added some:
  expr.test_with()
  expr.test_with_recursive()

To post a comment you must log in.
397. By Ian Booth

Merge from mainline

Revision history for this message
Free Ekanayaka (free.ekanayaka) wrote :

Looks good to me with the 2 points below fixed. +1

[1]

+ def __init__(self, name, select, **kwargs):

Any particular reason for not writing this as:

+ def __init__(self, name, select, recursive=False):

?

It feels more explicit to me.

[2]

Please document the new recursive parameter in the class docstring, like:

class With(Expr):
     """Compiles to a simple (name AS expr) used in constructing WITH clauses.

     @param recursive: <description>
     """

and add a note about it in the NEWS file.

review: Approve
Revision history for this message
Ian Booth (wallyworld) wrote :

Hi

Thank you. I'll definitely make the changes you suggest below; I think
they are all excellent points.

On 08/11/11 21:17, Free Ekanayaka wrote:
> Review: Approve
>
> Looks good to me with the 2 points below fixed. +1
>
> [1]
>
> + def __init__(self, name, select, **kwargs):
>
> Any particular reason for not writing this as:
>
> + def __init__(self, name, select, recursive=False):
>
> ?
>
> It feels more explicit to me.
>
> [2]
>
> Please document the new recursive parameter in the class docstring, like:
>
> class With(Expr):
> """Compiles to a simple (name AS expr) used in constructing WITH clauses.
>
> @param recursive:<description>
> """
>
> and add a note about it in the NEWS file.
>

398. By Ian Booth

Merge from main devel

399. By Ian Booth

Tweaks from code review

Unmerged revisions

399. By Ian Booth

Tweaks from code review

398. By Ian Booth

Merge from main devel

397. By Ian Booth

Merge from mainline

396. By Ian Booth

Extend WITH expression to support recursion

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches