Python Forum
mixing bytes with strings
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
mixing bytes with strings
#1
a found a case where i can use bytes with strings, though there could be more such cases. what i found by experimenting is that the str.translate() method accepts bytes for the table. the table just needs to be rather long to translate some Unicode characters. and, of course, it can only translate to a character with an ordinal from 0 to 255.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#2
Do you think this is an error or a feature ?
Reply
#3
an inconsistency.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#4
Then you should write this inconsistency to Python.org.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Question bytes and strings Skaperen 0 722 Aug-28-2023, 02:58 AM
Last Post: Skaperen
  supporting both strings and bytes in functions Skaperen 0 1,375 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,832 Aug-26-2019, 07:48 PM
Last Post: Skaperen
  to strings or to bytes, that is the question Skaperen 0 2,009 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