What variable type is returned from Open()?

Random832 random832 at fastmail.com
Wed Apr 15 17:28:14 EDT 2020


On Wed, Apr 15, 2020, at 12:11, dcwhatthe at gmail.com wrote:
> So you're saying this is a type _io.TextIOWrapper?  This type doesn't 
> show up, on the hint listbox (I'm using Wing IDE).  So if I type 
> var_file : _io, it doesn't show anything.

While others have pointed out that you shouldn't need a type hint here at all since it can be inferred, the correct type hint to use would be typing.TextIO.


More information about the Python-list mailing list