

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What is Practical Use of Reversed Set Operators in Python?
Reversed set operators are operators that are defined as:
s & z corresponds to s.__and__(z) z & s corresponds to s.__rand__(z)
These don't make much sense in normal operations like and, add, or, etc of simple objects. However in case of inheritence, reversed operations are particularly useful when dealing with subclasses because if the right operand is a subclass of the left operand the reversed operation is attempted first. You may have different implementations in parent and child classes.
These reversed operations are also used if the first operand returns NotImplemented.
- Related Questions & Answers
- What is a Practical Transformer?
- What is behavior of ++ and -- operators in Python?
- What is the use of comparison operators with MySQL subquery?
- What is a use of SQLWARN3 in a SQLCA? Explain with the help of a practical example?
- What is correct operators precedence in Python?
- What is an Aqua Treadmill? What are its practical benefits?
- What is different in | and OR operators in Python?
- What is CLUSTERED INDEX in DB2? Explain with the help of practical example.
- What is the difference between = and == operators in Python?
- What is operand of arithmetic operators in Java
- What is difference in Python operators != and "is not"?
- What is different in & and AND operators in Python?
- What is different in OR and AND operators in Python?
- What is NON CLUSTERED INDEX in DB2? Explain with the help of practical example
- What is Casting operators in C++?
Advertisements