terminology

What does '# noqa' mean in Python comments?

What does '# noqa' mean in Python comments? Question: While searching through a Python project, I found a few lines commented with # noqa. import sys sys.path.append(r’C:dev’) import some_module # noqa What does noqa mean in Python? Is it specific to Python only? Asked By: Ishpreet || Source Answers: Adding # noqa to a line …

Total answers: 4

Terminology: A user-defined function object attribute?

Terminology: A user-defined function object attribute? Question: According to Python 2.7.12 documentation, User-defined methods: User-defined method objects may be created when getting an attribute of a class (perhaps via an instance of that class), if that attribute is a user-defined function object, an unbound user-defined method object, or a class method object. When the attribute …

Total answers: 1

In python regex, are character classes same as special sequences?

In python regex, are character classes same as special sequences? Question: From the documentation link here https://docs.python.org/3/library/re.html [] – (used to indicate a set of characters) Character classes such as w or S (defined below) are also accepted inside a set What are character classes? I am only familiar with special characters (*,+,?, etc) and …

Total answers: 1

Python abstract base classes, difference between a mixin & abstract method

Python abstract base classes, difference between a mixin & abstract method Question: The table below displays various abstract base classes that are prevalent throughout Python. However, I am uncertain about their specific usage in this context. Can you explain the distinction between the ‘Abstract Methods’ column and the ‘Mixin Methods’ column? Are the methods in …

Total answers: 2

What does abstraction mean in programming?

What does abstraction mean in programming? Question: I’m learning python and I’m not sure of understanding the following statement : “The function (including its name) can capture our mental chunking, or abstraction, of the problem.” It’s the part that is in bold that I don’t understand the meaning in terms of programming. The quote comes …

Total answers: 7

What are iterator, iterable, and iteration?

What are iterator, iterable, and iteration? Question: What are "iterable", "iterator", and "iteration" in Python? How are they defined? Asked By: thechrishaddad || Source Answers: An iterable is a object which has a __iter__() method. It can possibly iterated over several times, such as list()s and tuple()s. An iterator is the object which iterates. It …

Total answers: 16

What is monkey patching?

What is monkey patching? Question: I am trying to understand, what is monkey patching or a monkey patch? Is that something like methods/operators overloading or delegating? Does it have anything common with these things? Asked By: Sergei Basharov || Source Answers: According to Wikipedia: In Python, the term monkey patch only refers to dynamic modifications …

Total answers: 8

Python : terminology 'class' VS 'type'

Python : terminology 'class' VS 'type' Question: Just a simple question : when should I use the term ‘class’, and when should I use the term ‘type’ in Python ? is ‘class’ only for user-defined types, and ‘type’ for built-in types ? or now that everything is a type … should I use always ‘type’ …

Total answers: 6

What does it mean if a Python object is "subscriptable" or not?

What does it mean if a Python object is "subscriptable" or not? Question: Which types of objects fall into the domain of “subscriptable”? Asked By: Alistair || Source Answers: It basically means that the object implements the __getitem__() method. In other words, it describes objects that are “containers”, meaning they contain other objects. This includes …

Total answers: 7