IWETHEY v. 0.3.0 | TODO
1,095 registered users | 2 active users | 3 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New Stupid Python question
In Python, is there any semantic difference between 'string' and "string"?

I notice a lot of sample text does assignments thus:

d={"answer":42,"question":None}

when

d={'answer':42,'question':None}

does the same thing, without using the shift key, and thus reducing mistypes.

Any reasons?
New Would make it look too much like Pascal
IIRC, in the land of Delphi, 'string' and "c"(har) reign.

Mostly just a matter of being normative with the C and Java crowd that uses "string" and 'c'(har). Consistency is the main thing.

[Edit note: can't be having a grammer mistake when criticizing Delphi now, can we?]
Expand Edited by ChrisR Aug. 4, 2005, 03:54:45 PM EDT
New Only if you want the Double-Whammy from CRC. HTH!
New Actually, no; both are '. [Duh-the other was what you said!]
So, umm... What was your edit? To me, both versions look exactly the same.

And it still reads "...being normative with...", which is a somewhat peculiar usage of "normative", that I neither recognize nor could swear that I understand what you mean by it here. But, "grammer"(sic)? No, I don't think so. AFAIK, word *meaning* is a subject distinct from grammar(sic!).


   [link|mailto:MyUserId@MyISP.CountryCode|Christian R. Conrad]
(I live in Finland, and my e-mail in-box is at the Saunalahti company.)
Your lies are of Microsoftian Scale and boring to boot. Your 'depression' may be the closest you ever come to recognizing truth: you have no 'inferiority complex', you are inferior - and something inside you recognizes this. - [link|http://z.iwethey.org/forums/render/content/show?contentid=71575|Ashton Brown]
Expand Edited by CRConrad Aug. 6, 2005, 07:34:54 PM EDT
New too vs. to in the title.
--
[link|mailto:greg@gregfolkert.net|greg],
[link|http://www.iwethey.org/ed_curry|REMEMBER ED CURRY!] @ iwethey
[image|http://www.danasoft.com/vipersig.jpg||||]
New Ah, thanks! (Heck, that *is* a hard one to catch, isn't it?)
New You, usually do.
--
[link|mailto:greg@gregfolkert.net|greg],
[link|http://www.iwethey.org/ed_curry|REMEMBER ED CURRY!] @ iwethey
[image|http://www.danasoft.com/vipersig.jpg||||]
New Yes.
In single quotes, double quotes don't need escaping, and vice versa.

'He said, "Thane\\'s question."'

"He said, \\"Thane's question.\\""

Regards,

-scott anderson

"Welcome to Rivendell, Mr. Anderson..."
     Stupid Python question - (inthane-chan) - (7)
         Would make it look too much like Pascal - (ChrisR) - (5)
             Only if you want the Double-Whammy from CRC. HTH! -NT - (Another Scott)
             Actually, no; both are '. [Duh-the other was what you said!] - (CRConrad) - (3)
                 too vs. to in the title. -NT - (folkert) - (2)
                     Ah, thanks! (Heck, that *is* a hard one to catch, isn't it?) -NT - (CRConrad) - (1)
                         You, usually do. -NT - (folkert)
         Yes. - (admin)

You know the French. The problem with them is that they have no word for entrepreneur.
83 ms