Top "Magic-methods" questions

Magic methods are implicitly invoked by a programming language when some event or language construct is used.

Difference between __str__ and __repr__?

What is the difference between __str__ and __repr__ in Python?

python magic-methods repr
How does python numpy.where() work?

I am playing with numpy and digging through documentation and I have come across some magic. Namely I am talking …

python numpy magic-methods
PHP __get and __set magic methods

Unless I'm completely mistaken, the __get and __set methods are supposed to allow overloading of the → get and set. For …

php magic-methods
PHP - Indirect modification of overloaded property

I know this question has been asked several times, but none of them have a real answer for a workaround. …

php magic-methods
Python __call__ special method practical example

I know that __call__ method in a class is triggered when the instance of a class is called. However, I …

python methods call magic-methods
Best practice: PHP Magic Methods __set and __get

Possible Duplicate: Are Magic Methods Best practice in PHP? These are simple examples, but imagine you have more properties than …

php magic-methods
What is the __dict__.__dict__ attribute of a Python class?

>>> class A(object): pass ... >>> A.__dict__ <dictproxy object at 0x173ef30> >&…

python class metaprogramming magic-methods
Making a python user-defined class sortable, hashable

What methods need to be overridden/implemented when making user-defined classes sortable and/or hashable in python? What are the …

python class sorting hash magic-methods
Is it possible to overload Python assignment?

Is there a magic method that can overload the assignment operator, like __assign__(self, new_value)? I'd like to forbid …

python class methods assignment-operator magic-methods
How to document magic (_call and _callStatic) methods for IDEs

After many happy years coding in notepad++ and sublime, I've been advised to give a PHP IDE a go. I'm …

php documentation phpstorm magic-methods docblocks