Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
strange string
#3
(Apr-20-2019, 07:56 AM)Gribouillis Wrote: Try to print type(doc_str) perhaps.

i get <class 'botocore.docs.docstring.ClientMethodDocstring'> from that. so i probably should do str() on it. still, i expect attribute __doc__ to be a str already.

that seems to do it. len(str(doc_str)) = 3079

it looks like str() is doing the same thing as repr() including changing newline characters to the 2-str '\n' (which would be '\\n' in source code literal to create the same 2-str).

i tried copy.copy() and it just copies that class object as-is (e.g. the copy behaves the same).

i did dir(doc_str) and its attributes look like str attributes.

looking closer it looks like it has all str attributes plus a few more. so it's trying to be like a str in some way.
Tradition is peer pressure from dead people

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


Messages In This Thread
strange string - by Skaperen - Apr-19-2019, 08:22 PM
RE: strange string - by Gribouillis - Apr-20-2019, 07:56 AM
RE: strange string - by Skaperen - Apr-21-2019, 12:57 AM
RE: strange string - by Gribouillis - Apr-21-2019, 04:36 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Strange Characters in JSON returned string fioranosnake 4 5,330 Dec-02-2019, 07:25 PM
Last Post: fioranosnake
  Strange behaviour while splitting string? naknak12 2 2,631 Feb-18-2019, 01:57 PM
Last Post: naknak12

Forum Jump:

User Panel Messages

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