OT Signature quote [was Re: Unrecognized escape sequences in string literals]

Grant Edwards invalid at invalid
Fri Aug 14 18:17:36 CEST 2009

On 2009-08-14, Steven D'Aprano <steve at REMOVE-THIS-cybersource.com.au> wrote:
> On Fri, 14 Aug 2009 07:07:31 -0700, Aahz wrote:
>> "I saw `cout' being shifted "Hello world" times to the left and stopped
>> right there."  --Steve Gonedes
> Assuming that's something real, and not invented for humour, I presume 
> that's describing something possible in C++. Am I correct?

Yes.  In C++, the "<<" operator is overloaded.  Judging by the
context in which I've seen it used, it does something like
write strings to a stream.

> What the hell
> would it actually do???

IIRC in C++, 

   cout << "Hello world";

is equivalent to this in C:

   printf("Hellow world");

or this in Python:

   print "hellow world"

Grant Edwards                   grante             Yow! Bo Derek ruined
                                  at               my life!

More information about the Python-list mailing list