Re: python3 string format

2013-03-26 Thread Ian Kelly
On Tue, Mar 26, 2013 at 4:51 AM, Shiyao Ma wrote: > Thx for your reply. > I am using pycharm and simply press "go to declaration" which directs me to > a py file, containing the following code: > def format(*args, **kwargs): # known special case of str.format > """ > S.format(*args

Re: python3 string format

2013-03-26 Thread Shiyao Ma
Thx for your reply. I am using pycharm and simply press "go to declaration" which directs me to a py file, containing the following code: def format(*args, **kwargs): # known special case of str.format """ S.format(*args, **kwargs) -> string Return a formatted version of S,

Re: python3 string format

2013-03-25 Thread Ian Kelly
On Mon, Mar 25, 2013 at 10:24 PM, Shiyao Ma wrote: > HI. > one thing confuses me. > It is said in the pep3101 that "{}".format (x) will invoke the method > x.__format__ > However, I looked at the src of python3 and found: > in class str(object), the format simply contains a pass statement > in cla

python3 string format

2013-03-25 Thread Shiyao Ma
HI. one thing confuses me. It is said in the pep3101 that "{}".format (x) will invoke the method x.__format__ However, I looked at the src of python3 and found: in class str(object), the format simply contains a pass statement in class int(object), things is the same. So, what's the mechanism that