Skip to content

Conversation

@ackerleytng
Copy link
Contributor

Add parameters to exercise placeholder for variable-length-quantity.

Also change variable naming from bytes to bytes_ to avoid shadowing
python's bytes

Fixes: #651

Add parameters to exercise placeholder for variable-length-quantity.

Also changed variable naming from bytes to bytes_ to avoid shadowing
python's bytes

Fixes: exercism#651
Copy link
Contributor

@ilya-khadykin ilya-khadykin left a comment

Choose a reason for hiding this comment

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

Thanks, @ackerleytng

Please read my comment



def decode():
def decode(bytes_):
Copy link
Contributor

@ilya-khadykin ilya-khadykin Oct 21, 2017

Choose a reason for hiding this comment

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

Why not just use bytes?
Could you please explain your reasoning?

I didn't get your point about shadowing

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In python 3.6, bytes() is a built-in function https://docs.python.org/3/library/functions.html#func-bytes, and I didn't want to shadow that built-in function.

In line with PEP8 I added a trailing underscore:

If a function argument's name clashes with a reserved keyword, it is generally better to append a single trailing underscore rather than use an abbreviation or spelling corruption. Thus class_ is better than clss. (Perhaps better is to avoid such clashes by using a synonym.)

Copy link
Contributor

Choose a reason for hiding this comment

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

@ackerleytng now I understand, thanks!

@ilya-khadykin ilya-khadykin merged commit 849bae2 into exercism:master Oct 22, 2017
@ilya-khadykin
Copy link
Contributor

Thanks, @ackerleytng

@ackerleytng ackerleytng deleted the add-parameters-variable-length-quantity branch October 23, 2017 14:35
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.

2 participants