Python __and__() Magic Method

Syntax object.__and__(self, other) The Python __and__() method implements the built-in Bitwise AND & operation. So, when you cal x & y, Python attempts to call x.__and__(y). If the method is not implemented, Python first attempts to call __rand__ on the right operand and if this isn’t implemented either, it raises a TypeError. We call this … Read more

Earn Passive and Active Income ($200/h) as a Chainlink Validator and Freelance Consultant

Just stumbled upon this opportunity and freelancing niche that could be highly profitable in the Blockchain industry, fun, and sustainable for decades to come. Do you want to grab this opportunity? References from the video: Official website Chainlink: https://chain.link/ Run a Chainlink node: https://docs.chain.link/docs/running-a-chainlink-node/ The gap — nobody on Upwork offers their focused Chainlink services: … Read more

Python __rshift__() Magic Method

Syntax object.__rshift__(self, other) The Python __rshift__() method implements the built-in >> operation. So, when you cal x >> y, Python attempts to call x.__rshift__(y). If the method is not implemented, Python first attempts to call __rrshift__ on the right operand and if this isn’t implemented either, it raises a TypeError. We call this a “Dunder … Read more

Python __lshift__() Magic Method

Syntax object.__lshift__(self, other) The Python __lshift__() method implements the built-in << operation. So, when you cal x << y, Python attempts to call x.__lshift__(y). If the method is not implemented, Python first attempts to call __rlshift__ on the right operand and if this isn’t implemented either, it raises a TypeError. We call this a “Dunder … Read more

Self-Employed Programmer? A Simple Heuristic

Python Freelancer

Should you become your own boss, being self-employed? This is a valid question given the massive opportunities these days. Freelancing is growing double-digits percentages every year: One of the largest freelancing platforms Fiverr recently reported an 89% (!) annual growth rate! ?Β This article and video will help you decide if this opportunity is for you! … Read more

Python __pow__() Magic Method

Syntax object.__pow__(self, other) The Python __pow__() method implements the built-in exponentiation operation. So, when you call pow(a, b) or a ** b, Python attempts to call x.__pow__(y). If the method is not implemented, Python first attempts to call __rpow__ on the right operand and if this isn’t implemented either, it raises a TypeError. We call … Read more

Python Namespaces Made Simple

Namespace are everywhere in Python whether you realize it or not. If you don’t know about Python namespaces, you’ll eventually introduce nasty bugs into your Python code. Let’s fix this once and for all! πŸ™‚ As you read over the article, you can watch my explainer video: Why Namespaces? In many classes with 30+ students, … Read more

Python __divmod__() Magic Method

Syntax object.__divmod__(self, other) The Python __divmod__() method implements the built-in divmod operation. So, when you call divmod(a, b), Python attempts to call x.__divmod__(y). If the method is not implemented, Python first attempts to call __rdivmod__ on the right operand and if this isn’t implemented either, it raises a TypeError. We call this a “Dunder Method” … Read more

Python __mod__() Magic Method

Syntax object.__mod__(self, other) The Python __mod__() method implements the modulo operation % that per default returns the remainder of dividing the left by the right operand. Internally, Python attempts to call x.__mod__(y) to implement the modulo operation x%y. If the method is not implemented, Python first attempts to call __rmod__ on the right operand and … Read more