logoalt Hacker News

CreRecombinasetoday at 4:55 PM3 repliesview on HN

Why not just use a dictionary, or why not just leave the type unannotated? If you really can't (or don't want to) say anything about the type, then don't. Python is dynamically typed!


Replies

MeetingsBrowsertoday at 5:08 PM

The blog post does want to share some type information with users. They just want to prevent users from relying on a specific implementation of that type.

They are basically describing a public API backed by a private type that they can extend, rearrange, or otherwise modify without breaking the public contract.

sdeframondtoday at 5:06 PM

The point is to mark the constructor as "private" so that it is easy to spot unintended use during code reviews (or using linters).

techn00today at 5:06 PM

average python script writer