Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
bytes and strings
#1
Question 
does anyone use the bytes type when dealing with ASCII characters, such as when the input provides the characters as bytes and/or (especially when and) the output wants the characters from you in bytes?

or should i just always convert bytes to str when i need to dabble with the characters instead of working with bytes directly?

i wonder how i might opine about this if i were a Python developer for C level functions and interfaces. for example subprocess.Popen accepts either str or bytes. i'm not such a developer and that might be a good thing.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  supporting both strings and bytes in functions Skaperen 0 1,418 Nov-28-2019, 03:17 PM
Last Post: Skaperen
  print a list strings is fast but printing the joined strings is slow Skaperen 9 3,955 Aug-26-2019, 07:48 PM
Last Post: Skaperen
  mixing bytes with strings Skaperen 3 2,423 May-29-2019, 02:30 AM
Last Post: heiner55
  to strings or to bytes, that is the question Skaperen 0 2,047 Jul-07-2018, 08:35 PM
Last Post: Skaperen

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020