General statistics
List of Youtube channels
Youtube commenter search
Distinguished comments
About
Anony Mousse
Indently
comments
Comments by "Anony Mousse" (@anon_y_mousse) on "What Is "CaseInsensitiveDict" In Python?" video.
Personally, I only like type annotations when declaring a variable or when it's not obvious what type it will be from a function call. I use them as a sort of documentation of what type is expected, even if the language won't enforce it on variables. It does on function signatures, so why not everywhere else where you use them.
1
@machadinhos Even if all it does is call .lower() on the strings, being able to construct a new instantiation as he shows in the video without first filtering or filtering as you iterate would be pretty handy. Also, if in the future it was embedded into the language it could be more efficient and save more steps and more time.
1