magicmethods icon indicating copy to clipboard operation
magicmethods copied to clipboard

Guide to Python's magic methods

Results 21 magicmethods issues
Sort by recently updated
recently updated
newest added

> *New in version 3.6.* > abstractmethod `__fspath__()` > Return the file system path representation of the object. > > The method should only return a `str` or `bytes` object,...

This guide is a de-facto reference for all things that surrounded by double underscore, so it would be nice to see `__path__` there as well.

Every file is condensed every file into the README.md for ease of access. Contributors and Code are included. A more detailed TOC has been added, though links have been removed.

I could not find an email for you. I just want to say thank you for magic methods article!

This is a fantastic guide and the loss of rafekettler.com hurts. I learned so much from this guide, and would love to share it with others. @RafeKettler if you're still...

### Summary Domain Name regististration for rafekettler.com has elapsed. ### Upfront I would like to thank you for putting together this resource. I frequently refer back to it whenever I...

In section "Copying": http://www.rafekettler.com/magicmethods.html#copying Says: > When you want to deep copy an individual attribute, call copy.deepcopy() on that attribute with memodict as the first argument. Official documentation for Python...

If the user instantiates multiple `Distance` objects, the descriptors will interfere with each other. There are two (and-a-half) ways to fix this: 1. Attach a [`weakref.WeakKeyDictionary`](https://docs.python.org/3/library/weakref.html#weakref.WeakKeyDictionary) to instances of `Meter`....

I rewrote the descriptor example and prose. The previous Meter/Foot example, as written, stored the state in the descriptor object rather than the instances of the Distance class. This means...

You opened a parentheses and didn't close it at the end of the __del__ paragraph, the one that reads "(...) (like always closing a connection when you're done with it....