Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up @all directive and remove args #61

Merged
merged 4 commits into from
Jul 29, 2014
Merged

Clean up @all directive and remove args #61

merged 4 commits into from
Jul 29, 2014

Conversation

dbarnett
Copy link
Contributor

Fixes the @all directive so it's no longer completely broken (fixes #60).

Also removes support for the index args. They're pretty complex to explain, and in practice if anyone did need to add documentation for e.g., 2 of 3 overloaded usages, it wouldn't be that bad to duplicate it. If we end up really needing support for args, we can always add it back later without breaking anyone.

Helps with some @usage confusion mentioned in #38.

@dbarnett
Copy link
Contributor Author

@Soares

selection[:] = range(len(blocks))
else:
selection[:] = self.blocks
selection[:] = range(len(blocks))
for i in selection:
if i >= len(blocks):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This guard is now protecting against a condition that is not possible (an invalid selection). In fact, the whole loop can be replaced with:

for block in blocks:
  block.SetType(True)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simplified as suggested. (I'm totally flummoxed by parts of this code and terrified to refactor it 😀)

@xanderman
Copy link

LGTM

dbarnett added a commit that referenced this pull request Jul 29, 2014
Clean up @ALL directive and remove args
@dbarnett dbarnett merged commit 0c3b0a7 into master Jul 29, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

@all directive broken
2 participants