Skip to content

add bytes missing method #736

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

Closed
51 of 53 tasks
jgirardet opened this issue Mar 23, 2019 · 9 comments
Closed
51 of 53 tasks

add bytes missing method #736

jgirardet opened this issue Mar 23, 2019 · 9 comments

Comments

@jgirardet
Copy link
Contributor

jgirardet commented Mar 23, 2019

A thread to add missing bytes method :
I'll try to keep it up to date

  • bytes . __add__
  • bytes . __contains__
  • bytes . __getitem__
  • bytes . __getnewargs__
  • bytes . __init_subclass__
  • bytes . __mod__
  • bytes . __mul__
  • bytes . __reduce__
  • bytes . __reduce_ex__
  • bytes . __rmod__
  • bytes . __rmul__
  • bytes . __sizeof__
  • bytes . __subclasshook__
  • bytes . capitalize
  • bytes . center
  • bytes . count
  • bytes . decode
  • bytes . endswith
  • bytes . expandtabs
  • bytes . find
  • bytes . fromhex
  • bytes . hex
  • bytes . index
  • bytes . isalnum
  • bytes . isalpha
  • bytes . isascii
  • bytes . isdigit
  • bytes . islower
  • bytes . isspace
  • bytes . istitle
  • bytes . isupper
  • bytes . join
  • bytes . ljust
  • bytes . lower
  • bytes . lstrip
  • bytes . maketrans
  • bytes . partition
  • bytes . replace
  • bytes . rfind
  • bytes . rindex
  • bytes . rjust
  • bytes . rpartition
  • bytes . rsplit
  • bytes . rstrip
  • bytes . split
  • bytes . splitlines
  • bytes . startswith
  • bytes . strip
  • bytes . swapcase
  • bytes . title
  • bytes . translate
  • bytes . upper
  • bytes . zfill
@jgirardet
Copy link
Contributor Author

jgirardet commented Mar 23, 2019

I start with

 __add__, __contains__, __getitem__

@coolreader18
Copy link
Member

I made your list into checkboxes, so you can check each one off as you do it. Thanks for helping with this!

@jgirardet
Copy link
Contributor Author

thinking about it I think we should implement first the buffer protocol https://docs.python.org/3.7/glossary.html#term-bytes-like-object and then write bytes, memoryview and bytearray in top of that.
It would add some simplicity regarding type checking since b"abcd" == bytearray(b"abcd") == memoryview(b"abcd")
What do you think ?

@coolreader18
Copy link
Member

That sounds good. Would you do it with a trait á la #765?

@jgirardet
Copy link
Contributor Author

jgirardet commented Mar 31, 2019 via email

@isidentical
Copy link
Contributor

for bytes.__init_subclass__, check out #1346

@dralley
Copy link
Contributor

dralley commented Oct 3, 2019

Current status, only these are missing

bytes.__getnewargs__
bytes.__init_subclass__
bytes.__mod__
bytes.__rmod__

@xarus01
Copy link
Contributor

xarus01 commented Oct 23, 2019

bytes.__sizeof__ seems to be missing.

@youknowone
Copy link
Member

youknowone commented Jan 2, 2020

This is practically done 🙌 . __init_subclass__ will be covered by #1346. __getnewargs__ by pickle.

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

No branches or pull requests

6 participants