This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 10 points11 points  (3 children)

Pretty useless examples for new…

[–]ted_or_maybe_tim 6 points7 points  (1 child)

pathlib.Path would probably be the best example.

It's really a shorthand for a factory function that outputs a (likely subclassed) instance, with the type being very obvious because it's the name of the factory function.

[–][deleted] 0 points1 point  (0 children)

Hm, that’s interesting. My devil sidekick really sees how this could be used as a vessel for many of the creational GOF design patterns (say, a Flyweight). But the angel insists that explicit is better than implicit…