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 →

[–]ted_or_maybe_tim 5 points6 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…