[Python-ideas] Proposal: Use mypy syntax for function annotations
Greg Ewing
greg.ewing at canterbury.ac.nz
Thu Aug 14 03:44:13 CEST 2014
On 08/14/2014 01:26 PM, Andrew Barnert wrote:
> In Java or C++, it's… what? The sound option is a special JSONThing that
> has separate getObjectMemberString and getArrayMemberString and
> getObjectMemberInt, which is incredibly painful to use.
That's mainly because Java doesn't let you define your own
types that use convenient syntax such as [] for indexing.
Python doesn't have that problem, so a decent static type
system for Python should let you define a JSONThing class
that's fully type-safe while having a standard mapping
interface.
--
Greg
More information about the Python-ideas
mailing list