Python Forum
supporting both strings and bytes in functions
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
supporting both strings and bytes in functions
#1
in all my functions (Skaperens Function Collections) that take strings and return strings, i want to also support bytes and bytearray types, returning the same, without having to use different names. suggestions on doing this? i do know how, but interested in other people's thoughts.
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
Question bytes and strings Skaperen 0 722 Aug-28-2023, 02:58 AM
Last Post: Skaperen
  supporting both str and bytes on write file Skaperen 12 3,396 Jul-15-2022, 07:09 PM
Last Post: Skaperen
  print a list strings is fast but printing the joined strings is slow Skaperen 9 3,833 Aug-26-2019, 07:48 PM
Last Post: Skaperen
  mixing bytes with strings Skaperen 3 2,373 May-29-2019, 02:30 AM
Last Post: heiner55
  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