Skip to content

Conversation

@inducer
Copy link
Owner

@inducer inducer commented Jun 8, 2022

No description provided.

@inducer inducer requested a review from kaushikcfd June 8, 2022 05:03
Copy link
Collaborator

@kaushikcfd kaushikcfd left a comment

Choose a reason for hiding this comment

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

LGTM!

Comment on lines +1779 to 1782
logger.debug("data wrapper de-duplication: "
"%d encountered, %d kept, %d eliminated",
data_wrappers_encountered,
len(data_wrapper_cache),
Copy link
Collaborator

@kaushikcfd kaushikcfd Jun 8, 2022

Choose a reason for hiding this comment

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

Superficial: Violates PEP8. Also, there is https://github.com/Vimjas/vim-python-pep8-indent that I found to be helpful.

Copy link
Owner Author

Choose a reason for hiding this comment

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

It's no worse than before. :)

TBH: I do not understand the rationale for this PEP8 recommendation:

When using a hanging indent the following should be considered; there should be no arguments on the first line and further indentation should be used to clearly distinguish itself as a continuation line.

Using this code as an example, I don't find the arguments after the ( easy to miss, however I find the waste of vertical space quite noticeable (which I find at a premium even on my terminal, which has 104 rows available, cf. stty size). That's why I typically disable this rule in flake8. I also find this suggestion by flake8 to be puzzling:

foo = long_function_name(var_one, var_two,
                         var_three, var_four)

because it wastes horizontal and vertical space. I can see where the parenthesis is just fine. :)

Copy link
Collaborator

Choose a reason for hiding this comment

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

It's no worse than before

That's true :-)

because it wastes horizontal and vertical space.

That's fair. I personally find it easier to read arguments aligned with the parentheses. If the horizontal space starts becoming a concern one could insert a line break before the first argument.

But, it's subjective and so resolving :).

Copy link
Owner Author

Choose a reason for hiding this comment

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

I'll proceed here, but I'd like to summon @alexfikl for an opinion. I don't need to ram through my opinion here.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm mostly on the same page (don't particularly appreciate that recommendation) because

  • even on moderately long function names it wastes space and if it's nested a bit it just gets worse and worse,
  • doesn't survive renamings very well (especially with sed): two lines will need to be modified instead of one.

black doesn't align things either (from what I remember), but that's neither here nor there..

Copy link
Owner Author

Choose a reason for hiding this comment

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

Thanks for chiming in! I propose we stick with the current, "comfortably ambiguous" way, and leave the Flake8 rule disabled.

@inducer
Copy link
Owner Author

inducer commented Jun 8, 2022

(I'll wait for your responses here before merging.)

@kaushikcfd
Copy link
Collaborator

LGTM from my end, thanks! We could just do "Enable auto-merge[rebase]" which will avoid us having to update the branch, but if that's not your preferred path please merge as per your preference.

@inducer inducer enabled auto-merge (rebase) June 8, 2022 18:13
@inducer inducer force-pushed the various-cleanups branch from 0154423 to 5f10f4c Compare June 8, 2022 18:13
@inducer
Copy link
Owner Author

inducer commented Jun 8, 2022

LGTM from my end, thanks! We could just do "Enable auto-merge[rebase]" which will avoid us having to update the branch

If I do that, it just sits there. But there's a handy "update branch with rebase" button, which enables progress... so I clicked that. :)

@inducer inducer merged commit fcd5f54 into main Jun 8, 2022
@inducer inducer deleted the various-cleanups branch June 8, 2022 19:13
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.

4 participants