Skip to content
This repository has been archived by the owner on Nov 5, 2019. It is now read-only.

Merge util.py and _helpers.py #579

Merged

Conversation

pferate
Copy link
Contributor

@pferate pferate commented Aug 1, 2016

A new file, _helpers.py, was created without realizing that utils.py existed for the same purpose.

Resolves: #251, (partially) #428 (partial duplicate of #251)

@dhermes
Copy link
Contributor

dhermes commented Aug 1, 2016

@pferate I am the originator of _helpers and it was very much intentional. If you are merging them then utils should go away since it is public.

Also, I seem to recall there being an issue with the LICENSE on that file since it came from Guido on the protorpc project

@pferate
Copy link
Contributor Author

pferate commented Aug 1, 2016

Thanks for the info. I guess I misunderstood your comment from #251:

That's my fault for creating _helpers and not realizing util was there.

and assumed that the code in _helpers should go into utils.

@dhermes
Copy link
Contributor

dhermes commented Aug 1, 2016

Ahh that's a failure of my memory then, the thing I wrote at that time is the real truth.

The goal is a smaller surface area, not a larger one and none of the functions in _helpers are in the API surface area, so big 👍 there.

In addition to nuking util.py, I'd love to see a plan for deprecating use of the positional decorator.

@theacodes
Copy link
Contributor

In addition to nuking util.py, I'd love to see a plan for deprecating use of the positional decorator.

File a bug and put it in the 4.0.0 milestone.

@theacodes
Copy link
Contributor

In general, I'd prefer less public stuff in this library.

@dhermes
Copy link
Contributor

dhermes commented Aug 1, 2016

File a bug and put it in the 4.0.0 milestone.

I apparently already filed #428 for just this and you and @pferate got it in the right milestone

@nathanielmanistaatgoogle
Copy link
Contributor

... so is this pull request actionable or should it be closed? Is this where util.py should be killed off?

@theacodes
Copy link
Contributor

I don't see anything in utils that want to be public. Should merge utils into _helpers and remove utils?

@dhermes
Copy link
Contributor

dhermes commented Aug 3, 2016

Yes that

@pferate
Copy link
Contributor Author

pferate commented Aug 3, 2016

OK, I'll update this PR. With _helpers being private, should all of the functions and global variables within it be private as well? Or would that already be handled from the private module?

@dhermes
Copy link
Contributor

dhermes commented Aug 3, 2016

That is @nathanielmanistaatgoogle's territory (of having more refined opinions than others). IIUC he prefers that imported functions be public, and since the module is non-public, that will be very much OK. (I would suggest holding off of renames like _helpers._from_bytes for a separate PR.)

@theacodes
Copy link
Contributor

theacodes commented Aug 3, 2016

I also would prefer _helpers.from_bytes instead of _helpers._from_bytes.

Basically, functions that start with _ are module-private and modules that start with _ are package-private. A package-private module still has a right to have module-private attributes.

@pferate
Copy link
Contributor Author

pferate commented Aug 3, 2016

Thanks!

@pferate pferate force-pushed the refactor_helpers branch 2 times, most recently from 7337915 to 328b200 Compare August 4, 2016 16:13
@pferate
Copy link
Contributor Author

pferate commented Aug 4, 2016

PR has been updated (utils -> _helpers).

return scopes


def _add_query_parameter(url, name, value):

This comment was marked as spam.

This comment was marked as spam.

@theacodes
Copy link
Contributor

This change looks mostly good to me, @nathanielmanistaatgoogle to do the final review.

'guido@google.com (Guido van Rossum)',
]

__all__ = [

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@nathanielmanistaatgoogle
Copy link
Contributor

Done with my first round of review.


# 1 positional arg, 1 keyword-only arg.
@_helpers.positional(1)
def fn(pos, kwonly=None):

This comment was marked as spam.

A new file, `_helpers.py`, was created without realizing that
`utils.py` existed for the same purpose.

Moving all to `_helpers.py`.
@pferate
Copy link
Contributor Author

pferate commented Aug 4, 2016

PR has been updated. I will be creating another PR to remove the _ from functions in _helpers.

This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants