$ n: O! H; ^; da = 'python' 5 N$ x+ @& w& b3 u. ^b = "python"1 ?& M( S% B2 F' x& R; @: k2 Q- l2 m
c = '''python'''5 H3 P, }" ^) S
print(a, id(a))* {; ~ u6 h0 z' B9 Y# Q6 l7 ]
print(b, id(b)) ( a5 d$ S5 i: U5 dprint(c, id(c))7 r L- B3 p8 U _) ? i3 Q
1) V2 U; B8 W0 E! @9 {, W% T5 ]
2 * E, x+ J. X% ? G0 h. r" h U* t36 X5 `- N% D8 K' B( d3 N" U! V8 n
4 H; u: ~9 R. _# ~/ A5$ D$ k/ G; l* Y3 X2 j
6/ N8 ~! C% J& l- A( L2 b2 E
7 : l( u! E$ K' {1 d5 a6 ]9 f8 m6 D; R$ l' X( C1 H H9 ]
9 0 Y# \$ d- x( g# `+ `- `" b/ [+ E$ B0 _10; @: J H2 h+ m) t
11' d/ \1 g+ w) B
12 8 P/ G% l/ H4 l2 T13* Z* \' ^3 E/ i b0 [# T3 s) ^
T* z" m' J# b% v/ j. T2 a , D2 |' r3 o' a- p0 K; H! ~" ^2 J3.字符串驻留机制的几种情况(交互式)+ p( _) B$ r- I7 J2 W8 ?2 |2 l
字符串的长度为10 |- c% V; J" {9 e% X
符合标识符的字符串(只包含字母,数字,下划线) + Q, j* q' J# B2 ^/ Y; x字符串只在编译是进行驻留,而非运行时 2 p/ {) |$ r2 s3 g[-5,256]之间的整数数字9 |. d. R' v! |5 d6 F, n
>>> s1 = '' , W" o, y- @% e- e6 \. g4 d>>> s2 = '' $ p+ c: B9 B$ C; ^; W3 i9 `>>> s1 is s2- |) u" Y/ A k" w8 O+ N7 A
True ( ?) H) J! { r5 R>>>5 l6 Z! W0 ?3 Y9 z! [
>>> s1 = 'a'& f. W7 n+ f; T2 q, o5 C; z L' j Z( s
>>> s2 = 'a' s5 }* e) V; i: `
>>> s1 is s2 " x) y# d3 {9 r/ QTrue# b: y1 I |' q
>>>* @+ p, A, q; A, J; q8 U& j1 t1 c
>>> s1 = 'abc_def'7 D8 p9 L. j: F1 s
>>> s2 = 'abc_def'5 h( C V% X0 R( |( K3 Z$ h
>>> s1 is s2 - `* a c3 g5 JTrue * x/ j4 Z9 `# U+ l6 m" b>>> s1 = 'abc%def' ' o4 B5 u- @' `: @5 l>>> s2 = 'abc%def': S4 m" C& E0 j
>>> s1 == s2 , E' U/ R. n5 q/ ITrue: V4 i% S" E) j" b; g# P8 j
>>> s1 is s2 8 b8 m/ s! I2 JFalse; h! C/ x) T, u
>>> , L, x f9 `3 F>>> a = 256 # Z: P0 P$ n# G+ k9 z a4 t) h( e>>> b = 256 + L; }) }8 i! _1 A5 U6 a>>> a is b. d+ h6 U5 ~- g
True! T# m9 d j$ \! c5 d8 L
>>> a = 257 ! P. \) W9 j [9 v>>> b = 257+ F6 Q* w; _; L" f& h' s
>>> a is b / H6 ?3 A: n; ]" o/ P# q# H1 YFalse$ |' m! w: x# D' c' @- m& J- A6 p) P
>>> a == b w! j& u! H# m: P) F
True 2 R! h) M4 J( t' x" S5 n! N( U>>> : O7 _2 G9 o. m3 Q7 G# j" i3 b0 w) i& w
1 7 ^: n/ u1 s8 F3 P; h# Y2 9 v, d% S# f* `3- L( E( k D& ?
49 C- q; `: L, P- Z+ Y3 p4 W
5! U9 v3 v2 f# e3 j& ~7 |$ K
6 ) l/ B8 c3 @4 ?) g2 y7 & i$ j8 z- a5 f6 S9 o t" l8 . I5 w+ g+ V' f6 H d9 ; X8 M" ]. K2 w+ I- J7 a. }10 + f$ Y0 |9 {* H, E5 L( C114 t9 T- `: y# `0 ]
12 ) ~+ r* t, u% M! a4 u/ R13/ U4 m+ {! n' [8 \
14 - y$ L n) Z: j" _, Q4 n2 k5 y15 m6 ]/ T+ v0 w2 o5 ]% Y* Q
163 O0 ]5 f5 c4 v2 D' I/ X- `( j
174 P1 Q( j8 u' a# [
185 g" c' l3 G- J% M7 P# |
19$ O9 A3 x5 R% |* F" Q" e9 p
20 $ H% o j" P" o$ k9 y) a( |213 X' l& r5 c$ f# n7 M+ X8 L
22 0 ]$ w5 e3 X8 {% n23 ' Q* r' G p9 { k. z% f1 \24 1 Y# v- A$ P5 K: h& i25 6 w& C0 A2 E$ R" H" P* @26 7 i4 N, z( m* Q! S1 ]+ f27 . q9 A8 }( A# |; j6 r# s284 T. J9 f1 H% r" ]0 i1 e: o
29) s3 `& d7 L5 u, Y. f) r" z
305 {: D# q6 i: f! Z
316 P! u/ ]4 C7 l
322 U8 i( {: ]/ s; M6 C3 _7 ?
4.强制2个字符串指向同一个对象; L. N# w4 x. k$ t
sys中的intern方法强制两个字符串指向同一个对象 % i* h# s0 L6 S a) Z7 _4 J4 J 8 b; W" H0 H) a& ~0 W! V$ Z! m'''sys中的intern方法强制两个字符串指向同一个对象''' & Y3 l: r& X% p5 P) [7 n0 iimport sys! I3 W* x, i7 A6 f& T+ X$ i6 w
a = 'abc%' 4 r, o8 k; U `b = 'abc%'- X- q8 s& H L% u( r6 t0 I, E; }+ `
print(a is b) # True, l# w* n( m. a8 l
a = sys.intern(b)( c8 f8 r; F5 i6 @, ~: Y' Q
print(id(a), id(b)) # 2989905230512 2989905230512 + g& F K; m+ A3 i1 z# \; A- B1 c! A6 M/ H+ T. H
1 1 M3 Z& O9 a" ?3 e# w* x- o% J2 7 B. }7 g7 a: _- _4 \3; Y1 v7 X1 U6 z2 @
48 p3 r0 V8 P8 ~2 O+ Q+ Z1 u
5 : p- E; Q; `8 q! |67 U4 q. g% J$ r2 H
7 - N. k' h1 c* l7 N; ]8- J2 \# g" z3 N$ c
5. PyCharm对字符串进行了优化处理 " Z9 G P8 K+ A3 ^6.字符串驻留机制的优缺点 : I& H% p$ h7 R) ^0 v% e1 g0 X 当需要值相同的字符串时,可以直接从字符串池里拿来使用,避免频繁的创建和销毁,提升效率和节约内存,因此拼接字符串和修改字符串是会比较影响性能的。 $ \( ^- i( A( A, w7 ?- { ( B' b4 `7 U- O* x0 w l5 L 在需要进行字符串拼接时建议使用 str类型的join方法,而非+ ,因为join()方法是先计算出所有字符中的长度,然后再拷贝,只new一次对象,效率要比"+"效率高 。8 m7 d& a( h6 }/ I* z
6 s; W8 ^; D9 @: }2 |二、字符串类型的操作 - d7 t5 q! ^ N5 B- xPython类str内置源码: " c( P8 {, K. @7 D8 h: L, L* I( h/ @% z+ v# ^$ b" U! |+ i( R: B
class str(object): $ K$ }. o' Q9 l; G7 x' {9 T# M """ ( f: H6 K7 I. c! c% Z* _" L; @ str = "(对象)——> str ( U& s4 J# S% i% d5 n9 R. Q, m! J/ Z! C) ]' i# Q* ], g( J
Str (bytes_or_buffer[, encoding[, errors]]) -> Str 0 |2 }' j2 I: l% w ; K7 ]) J5 F f
从给定的对象创建一个新的字符串对象。如果编码或,则对象必须公开数据缓冲区 y3 Q- n; x% M: N! J. f 将使用给定的编码和错误处理程序进行解码。 , x7 C% u2 t1 B2 A$ I# q % z; t. f' d5 N' T0 M3 [
否则,返回object.__str__()的结果(如果已定义)或repr(对象)。( A7 {; m- u6 y
3 m! L9 j @+ G8 R" ], Q2 W 编码默认为sys.getdefaultencoding()。 ' L7 k) i" @. X) U 5 g! z* K/ p6 x& f
Errors默认为'strict'。 4 B' [: w9 `! M7 J: [) E0 U0 ~ """ ; a4 Y, i% i0 I9 h4 e7 I def capitalize(self, *args, **kwargs): # real signature unknown 3 T8 t3 m/ s0 m6 k9 v; \2 J8 I """ 4 c9 [" c1 E6 Y3 _! P8 R Return a capitalized version of the string. 0 ]& c6 J1 c' |+ G e% w5 [ 1 [: Y Z+ J! o( f More specifically, make the first character have upper case and the rest lower9 E& ]# o: V& ~, b7 |
case. & p1 ~, |- R: S$ W1 _. ~ """ + o4 u; a% I; o3 V! n3 X4 i. z: r pass, l$ }6 @5 ?1 |! A2 @% [
, G* }1 X5 V. f def casefold(self, *args, **kwargs): # real signature unknown : i3 J" p( ~; p, Z1 x: Q """ Return a version of the string suitable for caseless comparisons. """* ?8 h+ N, t7 S0 a
pass 1 O6 T5 G n( k: t 3 n' Z; N" Z$ S" T def center(self, *args, **kwargs): # real signature unknown. D0 {3 H4 H3 l: q0 X
"""# ?& ^: k. u! N0 v! H4 J1 _
返回一个居中长度为width的字符串。8 f1 O* V' W) H0 f4 K8 W8 r
6 J8 s$ _7 ~% M% ?, f- X0 G( D def count(self, sub, start=None, end=None): # real signature unknown; restored from __doc__# @% S, E1 v y9 F$ v& i
""" % {% s2 z; G# o7 _( B; b! X/ _, D% k S.count(sub[, start[, end]]) -> ; J$ g9 d* U% D, {8 D Y. h + e4 R5 C. O; \/ y( B, q+ j( F; x; ]) r int .count(sub[, start[, end]]返回子字符串sub in不重叠出现的次数 3 o# T2 f4 }) v. {. Z d- T7 a, C' V/ p5 [& I1 c 字符串(开始:结束)。可选参数start和end是用切片表示法解释。 6 G% K+ e2 v" _9 l) m4 h& m """- W9 p' j ~, u( j
return 0 9 M- a, S! |) n2 G* G1 s, U* a" T, h9 p b8 h3 z$ S
def encode(self, *args, **kwargs): # real signature unknown : ~7 Q1 Z7 z U. C! _- L """ L1 X' \" D4 J2 s/ T8 ]) O+ U Encode the string using the codec registered for encoding. ) h) c: ]: E2 ?" [+ x! {" t4 v9 M7 x
encoding- A7 H; _4 {+ Z! A
The encoding in which to encode the string. # v8 _) g) d+ r$ P% t3 N errors 0 e: g7 G& C- ~/ r+ Z' i The error handling scheme to use for encoding errors. : s$ x4 K( v' V$ A/ n d The default is 'strict' meaning that encoding errors raise a0 i1 m5 X9 I1 G& D0 r9 G; X
UnicodeEncodeError. Other possible values are 'ignore', 'replace' and ( |" K# {7 {. T% V! Y% N 'xmlcharrefreplace' as well as any other name registered with e8 t! a8 D( n' i: s# O* V) G codecs.register_error that can handle UnicodeEncodeErrors.: O4 q7 s, Z, \7 C
3 Q3 K1 d8 B3 ]" ?
使用注册用于编码的编解码器对字符串进行编码。+ V4 N# } U- M. _* N- p
" T0 i4 s3 D b6 d$ _# G. D
编码+ T+ \' T9 L7 U3 }$ y) p
用于编码字符串的编码方式。) H/ P8 D6 { I; i8 u% ^# W/ H
错误% o$ F2 a! @- j& j o
用于编码错误的错误处理方案。3 ?2 J! N' h( E( J3 V' s
默认值是'strict',意味着编码错误会引发UnicodeEncodeError。6 K+ N6 @8 c7 U7 M; B# z# L8 z1 O
其他可能的值有'ignore', 'replace'和'xmlcharrefreplace'以及注册的任何其他名称编解码器。 0 t% Y$ X* N. k: ?4 F6 z# Q 可以处理UnicodeEncodeErrors的register_error。2 X0 M5 M+ f; G) ^$ E! J. }
""" ( x! k3 P% m2 S8 V4 N0 _ pass S* F& y0 B" Y# {+ d }
. t4 _) `+ _5 z! [! a- r& ?! O
def endswith(self, suffix, start=None, end=None): # real signature unknown; restored from __doc__ ; h1 g: B- t4 K* E """ 8 B; Y0 [4 v% s% ?. |2 P S.endswith(suffix[, start[, end]]) -> bool ) l' ^; P" z5 u; A. ?6 e% U4 `( j. @. e5 L
Return True if S ends with the specified suffix, False otherwise.4 o% s/ Y; r E% D( r4 r
With optional start, test S beginning at that position. * f1 [& M V$ |) I/ ~1 u: Z With optional end, stop comparing S at that position.( O! f$ O2 \1 |. ^+ W
suffix can also be a tuple of strings to try. $ E2 b8 I4 W6 P """! ~; h" r4 G; K$ \- \& c
return False( x; R) ?. f' \' K& {9 [+ v
& q5 I- y/ E: m9 [8 i def expandtabs(self, *args, **kwargs): # real signature unknown 4 ^$ k+ G/ ]0 F# C( {5 H& a( a& u7 ? """ 2 T; _( x' W1 r$ ` Return a copy where all tab characters are expanded using spaces. X6 V6 Z+ @' r: P7 a) a9 e
# E! y" o( U& s1 R If tabsize is not given, a tab size of 8 characters is assumed.$ l6 m' v- z6 i0 N& k* U3 n7 P
""" ' L% N \" \3 U pass : Z2 I. e, J3 B+ @& D " r; n% D' K* J1 L def find(self, sub, start=None, end=None): # real signature unknown; restored from __doc__ ' P+ C4 w7 ~, q$ m: l6 Z """% ]! Y+ B! O& H# P2 s! A7 x8 m
S.find(sub[, start[, end]]) -> int! c* Z/ i( H) i, O
( o; w; T0 @5 A L# A: W* T8 q
Return the lowest index in S where substring sub is found, 0 F, v u8 L; n4 @ such that sub is contained within S[start:end]. Optional3 e. o1 {& ~4 T4 @
arguments start and end are interpreted as in slice notation.+ M* \6 o# d2 Q; _( D
3 i0 J2 I2 O6 U2 b1 `7 N- j Return -1 on failure.( o" [+ ?$ I: F! \5 |2 _
( D1 o7 Z4 p- U: {
S.find(sub[, start[, end]]) -> int : A6 ]+ @$ @9 }1 P$ ` 4 r, e X m. j m% x, L- m: q 返回S中找到子串sub的最低下标,这样,sub包含在S[start:end]中。 5 [. Y/ r' l7 W. v$ q; P 可选参数start和end被解释为切片表示法。9 |* s6 ^* l+ ^: f. {7 l. X* {
2 J% C- s1 o: G' l% m
失败时返回-1。5 }8 `" A2 b! \5 s5 r' g) a
7 x5 T- x) y4 {" S6 p4 m
""" ; X3 r; ~ ~( t- X' B0 g return 0 6 V& @6 ~* A8 S% E0 _# R* [; _$ U" ]% w1 Z% ^# S
def format(self, *args, **kwargs): # known special case of str.format1 {+ G* y* z3 E l
""" ) I" y) g. F7 i r5 g9 q8 t4 g ` S.format(*args, **kwargs) -> str$ h$ S% q1 m2 b2 z- ^+ j+ e
& `6 ^. W) U& T
Return a formatted version of S, using substitutions from args and kwargs. 0 R9 n/ v/ G$ K" d$ V The substitutions are identified by braces ('{' and '}').0 ]4 c' E) p C, u" Q7 R a
/ G3 P8 U& i( Y: Y
S.format(*args, **kwargs) -> str% W8 b6 R' f# \: ]
; Z" a" x" j K
使用args和kwargs的替换,返回S的格式化版本。 5 k4 D9 c+ H9 s 替换由大括号('{'和'}')标识。 ' N3 O, U$ I( v$ Y* f7 v9 V4 X """' L% p/ ?( k( b& |' F; w( n: \
pass 6 a0 E4 K1 G9 W/ B# N5 j" q+ P7 w8 K% \& B1 ]; F# v" Y
def format_map(self, mapping): # real signature unknown; restored from __doc__' \& m9 |7 |+ L5 K6 X# h" R9 F% Y. O
"""2 @' D' y' U: W% A! z& h L
S.format_map(mapping) -> str5 h- O a8 ~) G: {
1 A$ Y0 x# _* q$ _
Return a formatted version of S, using substitutions from mapping. 9 o+ c0 T# s) Z' P9 i' u& R# t; O6 P The substitutions are identified by braces ('{' and '}').: _: C# w: T& `' Z1 X% u' t
"""# P5 h! e+ T/ D8 \
return ""2 A7 g) F/ \' v2 h5 c" h3 E
. A$ K' i* r1 C" N3 b' K def index(self, sub, start=None, end=None): # real signature unknown; restored from __doc__4 _8 j0 Q1 X4 d: W& t
""" ( C! i* g9 x/ M7 R S.index(sub[, start[, end]]) -> int ' r# x. Z; M% J, \- \8 R K; Z/ y' {8 v
Return the lowest index in S where substring sub is found,0 y6 r! Y4 B8 y3 u% u% X
such that sub is contained within S[start:end]. Optional' L! J7 ^# h* }3 \# z9 u- n
arguments start and end are interpreted as in slice notation. ( l F: l1 v- H1 a$ `. k+ W0 X( U2 K. G' L
Raises ValueError when the substring is not found. 6 d8 m6 e; b$ d. X& P5 Y K) ~7 ~; G' X! c+ B: | S.index(sub[, start[, end]]) -> int 3 y$ F7 |) s- S0 @
.index(sub[, start[, end]] 3 _1 \9 b% Q, G1 k. p ( ~# d1 _2 o; v& t6 u% a
返回S中找到子串sub的最低下标,这样,sub包含在S[start:end]中。 6 ~) C3 ~2 B/ f: ^' U1 E1 ]. T 可选参数start和end被解释为切片表示法。 X+ o2 Q/ l W& h5 R , {+ y+ f7 g3 G, h6 K) h! N
当没有找到子字符串时引发ValueError。 0 L3 y+ J& E" v. ?% y """ . w2 s" n& \: z( b s return 0 ( L& [$ v X7 s8 @& I7 M8 |$ q/ S; ]9 h& b
def isalnum(self, *args, **kwargs): # real signature unknown 5 f; T, ~' P4 |$ L" H """9 ?3 d! r! n2 `; M. |& j
Return True if the string is an alpha-numeric string, False otherwise. " |2 W' _' ~; g" P C) x, i! Z3 I5 F% d& ^/ Q
A string is alpha-numeric if all characters in the string are alpha-numeric and ; O, ^& x% v( Q4 d5 X there is at least one character in the string. / q0 l) t0 R! D) Q2 n) f """ * Z7 M* ]6 g# b. V4 n2 q pass. }) f% A. T- A$ M- c/ R8 N
1 p4 A$ q% {- Z' w6 I5 \( [5 O def isalpha(self, *args, **kwargs): # real signature unknown 5 x% ]& y# C$ M" s( y: ~ """ 3 ?( ~! i( n1 J. r Return True if the string is an alphabetic string, False otherwise.9 o3 z5 d* G6 u; V2 k4 {. O5 z4 i
' f) H2 e5 y: k
A string is alphabetic if all characters in the string are alphabetic and there2 j, I Q# r7 {
is at least one character in the string. ; r/ X7 e# _( g! e3 u e! X """4 U$ }5 Y" N4 S; N, ?& U
pass , @/ M3 d7 T) c% K% N4 m, z5 p/ e2 P: D# }2 }: C
def isascii(self, *args, **kwargs): # real signature unknown2 } R3 ^& F7 s( D' R
""" 6 w g% M% o0 }8 ]6 v6 k, p Return True if all characters in the string are ASCII, False otherwise. + k! _" H+ M: V0 Y " N# S/ B! x( ^: |+ J: d# Z0 ^ ASCII characters have code points in the range U+0000-U+007F.! ]& K4 {9 \% o( Z
Empty string is ASCII too. 6 O# u/ h: D; v7 Z# o2 R """( Q& ]* s6 ]; }% G/ R2 h
pass 6 O$ c; u5 E$ ]7 u; n; o- b0 P , E; h& w$ O# d5 e( f3 I+ P, D H6 ` def isdecimal(self, *args, **kwargs): # real signature unknown : ` {0 J- H! O """ t$ a0 _( L9 b& I1 h: a3 m
Return True if the string is a decimal string, False otherwise. ! W: M7 O- U: t3 u* x& _ % \. f [% H( ~0 Y( J3 [% ]2 C( X K A string is a decimal string if all characters in the string are decimal and# n+ m+ H0 f: H7 K3 \) S6 x, B% p
there is at least one character in the string. 4 \6 D2 K9 K7 z5 I """8 V. j' l& l4 L5 T- f# y( _
pass2 ~& {3 e/ k. r3 g
' i1 U0 o+ Q/ P- b7 T5 r9 t a def isdigit(self, *args, **kwargs): # real signature unknown' n y) K& ~7 X
""" ' \- L3 F$ t4 q H Return True if the string is a digit string, False otherwise. ( V) P" r! F% T- l% V+ w( n 3 y, K& ?# n$ H, i+ B; U A A string is a digit string if all characters in the string are digits and there8 F6 q9 ?: Z5 @, V
is at least one character in the string. ! `9 t( O" ?: U6 u! d& n- V! N """ : {; Z/ M( R$ V4 M& B6 L) x- X$ N5 t pass 3 B4 ?0 j( H3 z8 m" x3 Y( }9 ]$ F( |# r# o9 i1 y
def isidentifier(self, *args, **kwargs): # real signature unknown1 f; h; J6 g/ X! E! J
"""- ~6 E6 `: y, Z; M/ d
Return True if the string is a valid Python identifier, False otherwise.) h e2 ?1 F3 y. X0 o( @; j
* r8 F, X G4 a# [ n
Call keyword.iskeyword(s) to test whether string s is a reserved identifier,3 v8 t1 [' B% J ~ I! a# _+ ?* Z
such as "def" or "class".- y t! z- b7 J
""" 1 m' Q0 n; d/ M' O3 W pass8 X3 s) l6 J/ E- {3 X! W* f
. u; P# f/ p8 {' w( g def islower(self, *args, **kwargs): # real signature unknown 2 `9 Q+ B2 ~4 d+ o( i8 ] """- ~% r: l/ Y* y) b% q$ v/ w
Return True if the string is a lowercase string, False otherwise. + z3 [* i4 Z1 _0 G4 @( D+ L6 D9 Q! p5 p7 n
A string is lowercase if all cased characters in the string are lowercase and . n% H1 _ I* N+ a, y: f there is at least one cased character in the string.( i! O/ u$ l" f( t5 n8 f/ t& E
""", k; J3 x- H( P
pass7 [+ E+ M# q- i r
# W3 v6 l4 ?% Y
def isnumeric(self, *args, **kwargs): # real signature unknown 1 f, A) V) M% k9 z) Z5 \$ U* Y """$ Y- ]. P* ^. [
Return True if the string is a numeric string, False otherwise. # [' j' r2 ?% \. i. A! p- [% [8 c5 c/ y
A string is numeric if all characters in the string are numeric and there is at R9 l: }4 U+ }) P least one character in the string. # n( |" i, B" r& ?+ J """ % C7 v; U; K& p& ?8 z) S" l pass 9 N. {# Y* a0 r7 w7 s4 f% a M4 L$ t1 |1 f+ C. y# Y
def isprintable(self, *args, **kwargs): # real signature unknown . j' y# M" m0 t7 L7 i! ^' D; } """8 U$ L+ }% Y0 @/ ^/ {
Return True if the string is printable, False otherwise. . z; T8 e' G: z/ q7 p . [# G1 @( p7 Q5 r+ c- w A string is printable if all of its characters are considered printable in : y2 X! Z$ b7 l# s1 |) f! _( P/ }- v' a repr() or if it is empty. . D3 \4 j" @" K """ 1 s( Z" Z; Q8 D pass 0 r' }$ U' m' ^- a1 I8 q; k& f' x4 I$ X5 z
def isspace(self, *args, **kwargs): # real signature unknown& B! Q# B' @, O
""" 6 d3 \* j2 f% Y: E3 _0 j Return True if the string is a whitespace string, False otherwise.$ A2 p6 f8 S, W
+ a0 Z G* t& W2 a
A string is whitespace if all characters in the string are whitespace and there# J( X" b( M; I
is at least one character in the string. ( P4 T2 x2 U( U! {& V2 P2 ^ """ |3 |, I& u0 q* O8 {$ D T0 ` pass2 x s) X$ t) K# Y
6 k, i( i0 m" t' I( }
def istitle(self, *args, **kwargs): # real signature unknown & S! W: x+ Z! h5 t7 T4 D """! U: ?+ c7 K& \. f
Return True if the string is a title-cased string, False otherwise. G2 h) n( q7 L
. q0 t1 r \1 c: I4 u In a title-cased string, upper- and title-case characters may only/ a& [' }: u- V+ ?: A
follow uncased characters and lowercase characters only cased ones.- N& E( v3 [, u3 K) C4 f0 W5 J
""" , ?6 z' ~8 F# g2 u' ]. A& l2 z pass ! m3 m# }- B) g! N# ]% B3 ?% S) C `" t4 N4 ?/ w
def isupper(self, *args, **kwargs): # real signature unknown 0 T& ]0 e* q: N+ C* F """ * b1 [" } O4 m' L7 [ Return True if the string is an uppercase string, False otherwise. & I; F3 B. Z6 m! B( e( O8 c5 `) {( ]
A string is uppercase if all cased characters in the string are uppercase and; |3 Y* \* G8 f1 H q% x, q
there is at least one cased character in the string. 6 ?8 `* D* W+ P# y """ V" m6 d; m8 ^- w ^8 ~ pass " z( ~. Q" i h$ `# I ( e7 @) h: _) L. {- \# x def join(self, ab=None, pq=None, rs=None): # real signature unknown; restored from __doc__ 6 s7 J8 @. D' |- x- E4 E6 G """ # O$ L8 S9 b5 r4 _; s2 t$ u Concatenate any number of strings.2 n: y n# N, v4 p4 k
I) C, S# h+ Y
The string whose method is called is inserted in between each given string. * U1 R6 A6 u2 j% ^ The result is returned as a new string.7 s5 l$ F& {( ]% P, I$ p, _7 x
* {7 _7 C% `% k4 y$ Q2 S* }; Y
Example: '.'.join(['ab', 'pq', 'rs']) -> 'ab.pq.rs' 4 \3 [6 W0 j0 _2 F1 V/ A5 G: ^1 R7 M4 |1 u- \" O( Y5 ~
连接任意数量的字符串。6 \* a% j+ b9 u( u* i; v& }: h$ Y
9 z9 G, b. ?% ]' J2 L
调用其方法的字符串被插入到每个给定字符串之间。 ; s, W+ g, n3 l# F% K$ i6 {9 e$ o 结果以新字符串的形式返回。$ X9 r) B* r D2 T( v* K3 ^
! B8 Z; U1 I% _
例如:“。”。Join (['ab', 'pq', 'rs']) -> 'ab.pq.rs' 4 t: B& q9 d" O/ D6 h% A """9 K: b% N& c3 q) O
pass2 a7 p! s; Z& W2 R/ v1 R
7 F: k G7 k# p; U: |* } t def ljust(self, *args, **kwargs): # real signature unknown + C( o8 E3 \8 R5 W/ e- M """! y) ~% u9 \6 h
Return a left-justified string of length width. 3 w, l& @5 ?! `7 |, P! M% {; [) M3 d( d$ V- j
Padding is done using the specified fill character (default is a space).2 Q( [% f5 @$ \+ C1 Y: Y
6 e+ m0 n1 U! E* G$ G" d 返回长度为width的左对齐字符串。 B& W$ C# j8 A2 R
0 D$ \% t' y* T9 m4 I3 d 使用指定的填充字符(默认为空格)填充。! ^4 G! e6 ^8 m
"""8 C( Q/ S5 v$ W+ I" Q- V1 b' o
pass 6 e. p! D" i* i" U; H 0 d. Y l4 h7 C9 K def lower(self, *args, **kwargs): # real signature unknown 5 g6 t7 m7 v) B9 P0 H t! R- E """ Return a copy of the string converted to lowercase. * G0 X9 d9 O, K2 | 返回转换为小写的字符串副本。""" ^# f r" M: m' w
pass 4 A; G5 [( `+ U% o . \4 ?6 M! z: H$ C% a2 o$ k def lstrip(self, *args, **kwargs): # real signature unknown * \3 _4 H6 C1 t. O3 d5 a' T6 \/ S """ 6 Q9 A: Z% G$ z# o* V$ ]& h Return a copy of the string with leading whitespace removed./ C% x5 @3 V" q# ?$ C
# L1 i; Q7 P+ u/ x* l V
If chars is given and not None, remove characters in chars instead.5 v) F' t: `+ x7 A- l# ?- y
/ ~. E4 p' Z9 E. w 返回删除前导空格的字符串副本。 # n' J r \* _( Y( h m" `8 b Y1 D+ d$ P8 Y
如果给出了chars而不是None,则删除chars中的字符。 ) J- h _+ k9 C% W8 S" i& L5 Q/ | """ . f: t: x4 b" B1 J) M9 I: h pass3 `$ p3 B1 X6 k
5 U8 ?6 P# O) G [. [* `; S
def maketrans(self, *args, **kwargs): # real signature unknown & K( \4 y7 t8 r1 b """ 7 ~ B& D% c4 `4 G; x& M5 G Return a translation table usable for str.translate().) o+ G \& @9 b# e3 f A2 O
; u* J _ m$ p, f! E& N
If there is only one argument, it must be a dictionary mapping Unicode T2 n! |- [: K ordinals (integers) or characters to Unicode ordinals, strings or None.3 G6 R7 {: ]5 o
Character keys will be then converted to ordinals. - v2 D! i3 v) u If there are two arguments, they must be strings of equal length, and ! m/ I- j# J1 _4 m3 m in the resulting dictionary, each character in x will be mapped to the $ m- {3 `9 b& @/ Y6 A character at the same position in y. If there is a third argument, it 2 L3 j1 h! M# s, Y must be a string, whose characters will be mapped to None in the result.( I4 l, O; r9 R7 ^% D: k. w
""" $ s- s; L* I2 D6 v$ s m- ^0 l pass 4 [; L" g/ g( ]4 k6 V) @: T1 S 7 P+ e8 }3 H( k0 u% t/ D def partition(self, *args, **kwargs): # real signature unknown 7 e, Z/ d1 ?3 ~! j: u' W0 U """ - T6 V, F8 n& ?/ ` Partition the string into three parts using the given separator.# Y" |! P5 b! D) b2 ~: e
3 Z/ M( `% U1 k This will search for the separator in the string. If the separator is found, / e$ u& H; W7 ]) ?6 E# a returns a 3-tuple containing the part before the separator, the separator 7 z4 o8 Y" w4 s/ ` itself, and the part after it.& _ B$ M; v7 w3 q8 z+ N( C' @3 u5 A
: Z; i& T4 N8 v* b. T$ | If the separator is not found, returns a 3-tuple containing the original string+ ~4 A) F! o" u: s. t2 I
and two empty strings.4 p: p; u$ j7 c' _- y0 `% ?6 v
"""9 G( ]. p3 u" {
pass5 ~! u/ b8 @4 y
6 D6 a6 [; L8 | {" r5 u% @
def replace(self, *args, **kwargs): # real signature unknown- \7 `3 c7 M/ ]- M, S) \5 w1 [7 Y4 m
""" 6 U6 j/ L: \1 G# z# N/ {! n0 H Return a copy with all occurrences of substring old replaced by new. . Z$ k5 Z. B/ \5 S# F( p, K2 i/ `# x: O; _, g6 I R8 `# R
count& l' ]" T/ ]7 g; U8 R9 _ [
Maximum number of occurrences to replace. 8 q) @. P9 h6 T: [. h5 X* @% y ` -1 (the default value) means replace all occurrences.2 i& {' h4 l5 M+ T6 B& J
9 h% v' O- R0 T& h8 ?2 X" y! w If the optional argument count is given, only the first count occurrences are ( m1 Y/ \ s( a, e! ^9 B: h replaced. + A5 \8 U* h! |7 p5 e I( k& L; a 1 Y) w! j: E, H4 I% W) s 返回一个副本,其中所有出现的子字符串old都被new替换。# o( _9 B- V3 ?* }! f
9 r# L" b! j" m3 c# { 数 : b* \" v) Q- Y' V T9 i: h) | 替换的最大次数。1 @. y8 Z* e, C: p7 S$ R. D9 w
-1(默认值)表示替换所有匹配项。 " H* I7 w$ _- H- C & m5 R/ R L) N! C! L 如果给出了可选参数count,则只出现第一个count更换。 % I+ t% b4 P" i+ _ """2 P; S8 |5 ^+ r
pass 7 Q+ P+ Y6 w& _7 @ $ b1 I* [0 g1 n5 s/ r, m def rfind(self, sub, start=None, end=None): # real signature unknown; restored from __doc__ , v! E+ f; f% d' l' Y+ k """ / I6 K! J1 A. [" y S.rfind(sub[, start[, end]]) -> int K M2 [6 I6 S
- \: o( D7 r4 E3 u" ], _ Return the highest index in S where substring sub is found,% ^4 x0 C7 f- R0 b0 t
such that sub is contained within S[start:end]. Optional , w0 p7 `* S- B, A7 v" h4 ] arguments start and end are interpreted as in slice notation.% @8 Z2 m4 b# G1 T( i; @
6 G! v0 f) |' |5 x$ ` P6 D Return -1 on failure.% g; K/ O1 d4 L) ]
""" 8 f% u* a$ q q1 T. l) F: } return 0 r# Q; }; q+ t' R( f+ s* M# V+ L$ f8 @3 w ~) }
def rindex(self, sub, start=None, end=None): # real signature unknown; restored from __doc__& ^* |9 l( O g
"""3 b, W$ ?4 [' Z6 G- t
S.rindex(sub[, start[, end]]) -> int 7 L& v' y8 Y( v7 P. ~7 r( `& V. f2 ]# a
Return the highest index in S where substring sub is found,& B3 O- S5 X$ \# {3 j+ ~
such that sub is contained within S[start:end]. Optional # [8 r' r! P" b( ]' ? arguments start and end are interpreted as in slice notation. 0 T4 w2 E% x! j! U1 a& @ 4 R7 V0 E4 ~% \9 t( j; ] Raises ValueError when the substring is not found.1 q: O; n( W8 |) c) T5 y
"""+ k4 V$ W6 ]- M- r; Y0 ^# M
return 0, w( M. G- c! c% F
, K1 L2 D# f4 [3 ~2 `; r$ p3 M
def rjust(self, *args, **kwargs): # real signature unknown+ `5 r' u, P& y B. a6 e
""" . i& e4 b9 ~% X3 X+ ~& C' d Return a right-justified string of length width. + Z( Q& Y& B8 ^ 2 v& `* ^/ m$ @; b" }. h, V Padding is done using the specified fill character (default is a space).9 I1 b5 r0 H- ^8 f
$ z- P, k# M2 J* j 返回长度为width的右对齐字符串。 $ n. y* n' y7 g8 l3 o! j0 K! p* \7 F H6 a/ R' C" G- C! i
使用指定的填充字符(默认为空格)填充。# [! [$ p& l* |) @' r: T
""" P/ v( E4 M1 w+ m6 m- } pass# _, J2 J; k! k0 p
z) r+ a/ y9 o: s4 q( V- R def rpartition(self, *args, **kwargs): # real signature unknown) y' [7 q. g* x! v- ^4 `
"""" V* K" w- ~- n; ?# h. p& b
Partition the string into three parts using the given separator.( R e* `3 {/ F* {
1 f1 D* Q5 ~/ a This will search for the separator in the string, starting at the end. If ; I- x- J0 ~, |/ N6 [0 e; P the separator is found, returns a 3-tuple containing the part before the: S' [1 N+ _1 B& s0 T) n! q
separator, the separator itself, and the part after it. # l ?/ U' `( l6 ?. }$ u; K+ G! F% L8 I% g E/ d
If the separator is not found, returns a 3-tuple containing two empty strings 2 y. X' V) T0 }* h and the original string.( w7 Y# Z1 j: p8 S- o$ p5 z/ d
""") ]4 N" t# F5 ]! o: H$ z
pass- X- k0 [: k g: L: B
C7 a, z! [5 U8 r5 Y. ^ def rsplit(self, *args, **kwargs): # real signature unknown- H4 o2 L: @5 T: O
"""6 P' P0 o1 E8 s* D: D
Return a list of the words in the string, using sep as the delimiter string.& s( A) m) c1 P( C: n
( q7 E0 ]8 g" h* P) U
sep* Q, @0 E( e2 n9 v+ F9 J
The delimiter according which to split the string.9 h( D- d2 q, @, n
None (the default value) means split according to any whitespace,5 c/ p) H1 E" C$ u
and discard empty strings from the result. 1 J3 r/ H3 I* k! N maxsplit ; a" s, x, x" q: A Maximum number of splits to do. 6 {1 \: J. K3 K" j' Y$ x( y -1 (the default value) means no limit./ M) H' I# \7 d/ `! h8 V1 W& I: m* Q
5 [2 I$ U" Z" ?( |
Splits are done starting at the end of the string and working to the front. 1 }% n; h9 _' U% t # \/ h+ I- @; }0 |# l( y 返回字符串中的单词列表,使用sep作为分隔符字符串。" c. h4 c* R+ z
sep+ |6 P5 Y2 k" N0 { q
用来分割字符串的分隔符。 , s; w1 P( o, g( m1 y# V6 h1 E None(默认值)表示根据任何空格进行分割,并从结果中丢弃空字符串。 # q' _+ m' i8 ]+ K2 I $ o6 A9 L {* a maxsplit ; G! z7 { g" a. G7 i 最大分割次数。 5 \" N, ~$ R4 D, r0 [% } -1(默认值)表示无限制。! X* m* c: {5 g0 J6 W7 F; d
6 Y/ A, C! C' s) e 劈叉从绳子的末端开始,一直到前面。 9 V- w# l4 H3 G0 a# `- \$ t% @- [ """- _: t g1 K" Q, L4 _" x+ v
pass4 v }7 N9 d7 `( U5 S, j! l" A
, z3 p7 ?/ F5 |, J% z4 ~ t: L3 }: y def rstrip(self, *args, **kwargs): # real signature unknown " Q& `9 u: b; [2 U. o3 ?: N6 J9 A8 ] """ M& f+ z# H/ W$ a) g
Return a copy of the string with trailing whitespace removed. % @9 P3 B" M {! u5 J' p% |/ ], o9 Z$ y) h
If chars is given and not None, remove characters in chars instead. 1 V! a4 q, _2 P! l4 ?5 z: m% U N6 w" c, } D6 X
返回字符串的副本,删除尾随空格。; }' v9 \( }" c; l6 E5 K9 h4 _; p
8 f4 ~* E6 G, L! q 如果给出了chars而不是None,则删除chars中的字符。 9 l. `2 j" Z# K& p& b' n """' [& j9 E# J% |5 U
pass 1 \) m" l( D' X0 ^2 |! N' ^9 V# P; [* R& w3 a
def split(self, *args, **kwargs): # real signature unknown 9 i! g9 E) K2 y* L& [: C4 l """ ' G. ^, c! M% [1 c) O Return a list of the words in the string, using sep as the delimiter string. / D- I0 r! Z& q9 B& w1 u" X! w+ \7 f; V 0 q! s. s; O3 j. C sep6 n2 x7 ?& p4 e. K2 \, g/ s5 [% L
The delimiter according which to split the string.% N9 O! b5 r ]3 n( [
None (the default value) means split according to any whitespace," r/ ~# N; m0 y a+ F, |; y
and discard empty strings from the result.9 P3 X/ H, ]2 Y2 V1 J: @! \+ n
maxsplit , r( Z0 R7 Z. T. M5 ?& i5 R Maximum number of splits to do." ]5 P/ i7 r- w
-1 (the default value) means no limit. y% H( Z0 H/ d& s( Y
""" 6 g1 @" j' _) Q3 b$ ?5 ?( K+ L$ B) C( } pass + O; |$ D) T V2 a, c" T( c 4 p6 @2 L* u% V' Q' u8 \ def splitlines(self, *args, **kwargs): # real signature unknown2 ] d! V5 m0 k5 w
""" - Q8 k* ]+ Z5 ]0 Y* J2 n% T Return a list of the lines in the string, breaking at line boundaries. ( N6 ~/ U2 V8 u4 U( o : N- z i8 P) P$ J Line breaks are not included in the resulting list unless keepends is given and$ f* {$ t/ A1 s/ O4 |+ }$ j- a
true. * H& ^1 I: L4 t$ X. o2 W """ ' v+ z. _" |/ \% x! V2 o pass* n! t m& S0 S. l1 d( e- X0 v
* D9 v2 Q# E) \9 r9 V/ l( q5 I
def startswith(self, prefix, start=None, end=None): # real signature unknown; restored from __doc__: o% m, L7 i' h- R
""" . y7 }6 B3 z; X S.startswith(prefix[, start[, end]]) -> bool , g+ U- Y* [0 Z* I# f. F2 X& }- H9 w% X* j6 `
Return True if S starts with the specified prefix, False otherwise.8 q( O! t) A4 {. V7 g9 H L
With optional start, test S beginning at that position.! s' u7 a' e! t% G
With optional end, stop comparing S at that position. 3 x& Z' U# ?7 j4 D; U- _! } prefix can also be a tuple of strings to try. 5 f9 K p4 z( D) b0 ? """ : z) P8 N! h( P+ D8 L return False & ]% I* X$ w9 S8 g! }- N, J5 x. B* J3 W" p
def strip(self, *args, **kwargs): # real signature unknown 7 q! w$ }. W$ z! }# @- r8 ~ ~ """+ v( Q: F1 {, K _$ ~/ @
Return a copy of the string with leading and trailing whitespace removed.4 z1 v. I) i6 }0 w
2 H# T/ ~- i( v& M( b8 c
If chars is given and not None, remove characters in chars instead./ h% ~" U0 ?5 ^ A3 d$ m
" ?) r) C* D1 n9 ~' b
返回删除前导和尾随空格的字符串副本。$ q% c [7 i2 }( w: S5 }2 H
7 r. c3 B' u& I( T3 \4 e; y 如果给出了chars而不是None,则删除chars中的字符。( j+ k1 A) F+ k8 m5 l
""" # X* m# `! ]4 [0 y4 h* J2 v0 @, ? pass* G4 v. W. L3 T3 o4 e
2 B3 D' Q. W- Y def swapcase(self, *args, **kwargs): # real signature unknown( o! Z' Y" g6 c3 o9 p; ], [
""" Convert uppercase characters to lowercase and lowercase characters to uppercase. """/ }+ j D5 T5 k( |3 X
pass8 x7 R! `/ E+ p3 I
" j- y+ [; K$ t% n4 s
def title(self, *args, **kwargs): # real signature unknown& o3 h& K) V) ~: x9 p8 I" E) V
"""$ n6 N' j) k$ j; p( ~
Return a version of the string where each word is titlecased. : u7 b0 w/ ?2 B( n5 s- F, ]* r- O L0 V% c
More specifically, words start with uppercased characters and all remaining . Y( C; E9 h; O% b# w- c cased characters have lower case. ) @. [" E t3 z9 L+ v. ? """1 v+ l! v6 E V4 D
pass8 D, D6 B. l, b" n4 i; W$ T7 \% L
6 t+ D: X4 a* |: \6 _$ p1 a8 x def translate(self, *args, **kwargs): # real signature unknown 8 D$ a) K" E( C% c& |$ ^, X """ / L2 H: r& z( _3 s% _! l Replace each character in the string using the given translation table. : D2 Y4 z+ y. ~. e1 z, X ( J X A1 T# P7 s' j1 p table5 J S* `& T) _2 `) P# M; \; ]
Translation table, which must be a mapping of Unicode ordinals to* Z% b* N: ?- I$ w4 D# z/ L
Unicode ordinals, strings, or None. 0 W* G) g/ x. _# s7 a; k. A$ Q1 N' i0 D# d: q6 D5 A0 F I' g0 J, N
The table must implement lookup/indexing via __getitem__, for instance a 1 F* @9 R9 i$ J$ G3 |/ }" b! `' Y dictionary or list. If this operation raises LookupError, the character is * q) [6 s( o n left untouched. Characters mapped to None are deleted.% l5 n& M K! s" t$ T) V2 x
""", q! p9 m. E2 R. ^6 ]! C
pass9 j" p0 p0 K K/ u$ p8 S
: d% {+ y% Q5 {
def upper(self, *args, **kwargs): # real signature unknown4 h. E; _& H" t4 n4 m
""" Return a copy of the string converted to uppercase. """ $ g" X" z0 @9 L! M% D' D pass# p7 E% n7 M0 V! _. Q' i
( N9 N0 Y5 y/ ~0 q def zfill(self, *args, **kwargs): # real signature unknown * Z% k1 z3 [6 t" @' y2 y! m C """7 d6 H( R/ E* a3 t( M0 O
Pad a numeric string with zeros on the left, to fill a field of the given width.) ^: d$ G2 S" u. [$ V: r+ q' u
2 m2 N% }+ L. s% T4 m9 _: [ The string is never truncated.( q+ Z; E1 ^) [+ [/ c( _5 `
"""7 O5 q. Y" E/ e. a. _9 Q- H4 Y
pass* f6 _% r7 W, ?+ Z
; s1 B( n0 z: c. k) l+ Y def __add__(self, *args, **kwargs): # real signature unknown8 S% W$ q8 O$ I9 H- j x, Q9 P/ J
""" Return self+value. """3 |! D) u& o6 J3 F
pass 7 `3 Y J- @0 G8 H0 Q3 D& t 7 V& m. d/ d: _ def __contains__(self, *args, **kwargs): # real signature unknown 9 v- ^2 S6 z) i! l/ V """ Return key in self. """9 o% v p- K' e* X+ {9 ]
pass ; k) I' F' x: M% R' c1 R/ J/ Z" ]- o. p9 s q" P$ t
def __eq__(self, *args, **kwargs): # real signature unknown 7 z' W7 ^& V2 n$ d# W """ Return self==value. """ " d( x6 V4 E7 r3 T5 a pass, M( _* r9 P+ Y4 q( A9 p0 o5 h
& ?% T* V0 B$ J( u8 G
def __format__(self, *args, **kwargs): # real signature unknown& }5 ?5 U3 F; e/ Q; [
""" Return a formatted version of the string as described by format_spec. """- p9 N1 v1 Q1 @! C
pass3 V [$ z( A8 A4 J" k! E
" q+ `' o1 x8 c4 {* h j1 L Y def __getattribute__(self, *args, **kwargs): # real signature unknown# T% \& _7 s6 w* C
""" Return getattr(self, name). """3 E" ?4 C! L+ h: o* o3 [' Q
pass 0 ?2 X5 F# Y Y) L& a" [; y% ^ 7 S, c2 ?; e- l( R+ ^; W3 r def __getitem__(self, *args, **kwargs): # real signature unknown 7 L# x( y5 k/ N% [( e- B( y# n+ { """ Return self[key]. """9 o) A- K* W2 C; w, e' O% Q
pass" [* l$ a) S9 m+ K
, Y2 ^/ N& T A0 O6 X; }
def __getnewargs__(self, *args, **kwargs): # real signature unknown) Z: \, O7 N& p3 N- ]5 Q. g0 m
pass 5 h9 t! |. u& h% i% D. x/ q1 R# L8 Q2 B; ]* R# a3 P
def __ge__(self, *args, **kwargs): # real signature unknown . Z$ {2 {3 b' n; C """ Return self>=value. """& B# V$ i1 f& q" _) h- X( h
pass0 P' }4 g5 U! c( t. I9 h4 I7 m! }
4 Y7 W, _$ P5 `3 C" q h
def __gt__(self, *args, **kwargs): # real signature unknown ) \8 |/ m$ ]$ A1 `2 L """ Return self>value. """ ! U6 h0 V3 a/ ~: T9 J- @$ k! ?: h pass # `: ^: y# F4 ]+ c7 G! q- [: e& o9 Y8 j/ ?$ q/ k0 g6 O* `; o
def __hash__(self, *args, **kwargs): # real signature unknown" n9 v7 P" s, j* Q; t! {5 l
""" Return hash(self). """ 6 X& m. P3 x! P; A# P+ \ pass 4 n2 ?# F0 P/ t: q/ n8 I3 u4 i9 ?( t4 k3 T' H# v( r6 k
def __init__(self, value='', encoding=None, errors='strict'): # known special case of str.__init__ ( o1 \" d- K! V5 @, X7 [ """ ) W$ _; n, N; Y% |3 g* M str(object='') -> str5 J+ v/ m6 N2 ?
str(bytes_or_buffer[, encoding[, errors]]) -> str1 X) u. U/ X! n
/ {9 E: D! t) S1 X8 ~5 I
Create a new string object from the given object. If encoding or4 Q1 i( L/ J4 m( Q! W
errors is specified, then the object must expose a data buffer# R6 E, U( b8 Y7 J) k
that will be decoded using the given encoding and error handler.: x8 {+ @. `9 M0 m# B& ]
Otherwise, returns the result of object.__str__() (if defined) : t' k# T- o6 E3 ] or repr(object). 4 ]( u" E4 Z: a! A encoding defaults to sys.getdefaultencoding(). 5 |' c# N9 ^* h' W7 B errors defaults to 'strict'. ( d% b* z5 K) @( X$ j$ `' V # (copied from class doc) " x) y/ L# F8 v3 l( U* z" T+ T* i """5 T7 J1 t. _. E+ Z1 z$ S
pass2 n% _5 D* y6 d7 Q6 m# Y3 n
8 _/ P5 I1 B$ i8 h& x: M
def __iter__(self, *args, **kwargs): # real signature unknown 6 j( T- V, p x+ Q """ Implement iter(self). """4 [( L& y6 R- s/ C+ `. p
pass n% E9 r6 T9 k/ @9 o/ L
& B0 T6 c! e+ C% F. D5 I: S
def __len__(self, *args, **kwargs): # real signature unknown - p0 w5 D! h# N9 D- w. W8 m) M# _ """ Return len(self). """ : l" \ k8 e; Q: r& G% E v pass 7 s) w- _6 y2 b, y2 s $ r6 K+ q* |" J! W+ U; ^7 O- } def __le__(self, *args, **kwargs): # real signature unknown 5 p9 m) @; M! Z& l. T) j2 G """ Return self<=value. """& w: S1 v6 X1 q, S( v
pass+ \7 T3 G& y, s9 B8 O9 v
: q6 z4 e% e Y# i4 w6 x
def __lt__(self, *args, **kwargs): # real signature unknown, [+ ^8 j' H3 S7 C( H
""" Return self<value. """ 7 B; Z# N% H5 N5 R' [" g pass/ Z, k# i# E# d) [3 ]7 T
' Z( ] |* B7 `) I9 q9 b6 S; ]
def __mod__(self, *args, **kwargs): # real signature unknown- f1 F7 b# L) W1 m8 T8 m
""" Return self%value. """# S: |: R1 F9 C1 p2 E9 s% b- H- `
pass0 N- l: i; ` V$ C- |% F4 b2 Q
3 d5 z: _& x% O1 l# c- a
def __mul__(self, *args, **kwargs): # real signature unknown ; N( m T+ h+ K2 L. e/ E """ Return self*value. """8 \/ Q* w9 ?. {: O
pass % O/ K! f* Y ~) _/ w! V7 G7 p2 h. U# C( `2 ? r
@staticmethod # known case of __new__ * a2 W/ O' m$ g/ [: o5 c3 T def __new__(*args, **kwargs): # real signature unknown0 y' n1 a, F( |8 `+ G- b# P6 _6 o
""" Create and return a new object. See help(type) for accurate signature. """$ t: h( B9 U' G# C2 M4 x
pass 8 G% |- R" P6 t: I* p9 z# \: ~ + ` d: [% F7 N& U" Q. Z9 N4 B def __ne__(self, *args, **kwargs): # real signature unknown, J- J8 _. I* B J
""" Return self!=value. """3 y" j. B' D7 |# t' |
pass, Q- L3 o W$ z8 w$ O6 n