aio-libs / aiomcache

Minimal asyncio memcached client
BSD 2-Clause "Simplified" License
141 stars 38 forks source link

change 2 command, use formating literals #404

Closed ArtemIsmagilov closed 5 months ago

ArtemIsmagilov commented 5 months ago

I try rewrite cmd(s). this optional code maybe easier to read and work.

Dreamsorcerer commented 5 months ago

Same as the previous one, I'm not convinced this is an improvement when using legacy % string formatting with nested f-string formatting.

ArtemIsmagilov commented 5 months ago

@Dreamsorcerer. About this PR answered in #403. This is apparently a matter of preference code. Even considering that literals themselves are faster than methods and loops, this has absolutely nothing to do with our args. Therefore, this is only a point of view on formating. You can cancel this PR because it does not correspond to the vision of the future project. Thank you for leaving a comment.

ArtemIsmagilov commented 5 months ago

To be honest, we usually use join when we don't know how many arguments need to be converted into a byte string. however, in our case, the rigid argument notation fits very well here.

ArtemIsmagilov commented 5 months ago

After reading this pep, we can only suggest rewriting it with %b since this is a specification for python3. https://peps.python.org/pep-0461/#interpolation

Dreamsorcerer commented 5 months ago

After reading this pep, we can only suggest rewriting it with %b since this is a specification for python3. https://peps.python.org/pep-0461/#interpolation

Yep, just what I said on the other PR, as I saw an update there first.

ArtemIsmagilov commented 5 months ago

After reading this pep, we can only suggest rewriting it with %b since this is a specification for python3. https://peps.python.org/pep-0461/#interpolation

Yep, just what I said on the other PR, as I saw an update there first.

Great, then I'll redo the PR. Thank you.