2009-02-27

Перегрузка операторов в Python

Оказывается перегрузка операторов есть не только в C++, но и в Питоне тоже...

A class can implement certain operations that are invoked by special syntax (such as arithmetic operations or subscripting and slicing) by defining methods with special names.This is Python's approach to operator overloading, allowing classes to define their own behavior with respect to language operators.

 

 

комментарии:

 

Для того чтобы каждый раз не представляться можно войти как зарегистрированный пользователь.

Имя*

разрешены только теги br, font, span, p, strong, u, p, blockquote, a, div, img - остальные будут безжалостно удаляться