Python Worst Practices

Christian Gollwitzer auriocus at gmx.de
Tue Mar 3 03:51:04 EST 2015


Am 28.02.15 um 02:44 schrieb Chris Angelico:
> On Sat, Feb 28, 2015 at 12:32 PM,  <sohcahtoa82 at gmail.com> wrote:
>> For example, I've seen someone create a Socket class, then created an operator overload that allowed you to "add" a string to your socket to make the socket send the string, with the result being a status code indicating success or an error.
>>
> 
> Why not left shift the socket by that string, the result being the
> original socket? At least that has precedent...
> 

Are you trying to pick on C++ streams? I could never understand why
anybody has problems with an arrow << that means "put into the left
thing" instead of "shift the bits to the left". How often do you use
bitshift operations in your programs as opposed to output? Ot would be
equally silly to complain, that in Python you divide a string by a
tuple, and the modulus gives you a formatted string.
	
	Christian




More information about the Python-list mailing list