[Tutor] question about operator overloading

Dave Angel d at davea.name
Tue Mar 6 03:42:33 CET 2012


On 03/05/2012 06:20 PM, Alan Gauld wrote:
> On 05/03/12 21:25, Dave Angel wrote:
>
>> It's not clear what __add__() should mean for physical files.
>
> My guess would be similar to the cat operator in Unix:
>
> $ cat file1, file2 > file3
>
> is equivalent to
>
> file3 = file1 + file2
>
> But of course, thats just my interpretation of file addition...
>

So somehow assigning the object to file3 will write the data to a file 
by the name "file3" ?  I know about __add__(), but didn't know we had 
__assign__()


-- 

DaveA



More information about the Tutor mailing list