June 2017
Beginner to intermediate
274 pages
6h 49m
English
So, let's take a look at our factory-making decorator in action. Refer to the following screenshot:

Notice that the thing named Unique is in fact the factory function that was created for the Unique class, rather than the Unique class itself. The actual class ends up being named Unique.type. Also, notice that u1 and u3 are not just equal but actually the same object; meanwhile, u2, which was created with different arguments, is different.
Read now
Unlock full access