All Questions
5 questions
-1
votes
1
answer
373
views
The pythonic way: replacing interfaces with ducktyping vs inheritence
tldr: I have consumer-like classes that require a number of pieces of information to do their job. It's an "all or nothing" kind of thing: the "producers" providing them with data need to provide all ...
3
votes
2
answers
1k
views
Is “A programmer-defined type.” a right definition of "class" in Python?
In Think Python 2e "class" is defined as "A programmer-defined type. A class definition creates a new class object."
But isn't a built-in type considered a class too?
Using Python 3.4.0, the ...
7
votes
2
answers
10k
views
How many types of polymorphism are there in the Python language?
I just read an article by Luca Cardelli and he explained types of polymorphism which are:
The article is named On Understanding Types, Data Abstraction, and Polymorphism.
Types of Polymorphism
...
54
votes
5
answers
40k
views
Are Python mixins an anti-pattern?
I'm fully aware that pylint and other static analysis tools are not all-knowing, and sometimes their advice must be disobeyed. (This applies for various classes of messages, not just conventions.)
If ...
4
votes
1
answer
323
views
What is the advantage of determining scopes statically and using them dynamically in case of Python?
Firstly let me clarify that I know C and am learning Python. So my OOPS is kind of bad.
I was reading the official tutorial and found this
Although scopes are determined statically, they are used ...