Closed
Description
csv.writer
is an import of _csv.writer
. #3581 changed _csv.writer
to take dialect: Union[_csv.Dialect, str]
. This is correct, but now csv.Dialect
-- which is distinct from _csv.Dialect
-- is no longer a valid argument type for csv.writer
.
For example, if someone was to define their own class MyDialect(csv.Dialect)
, a type checker would be correct to raise a "wrong argument type" error for a call like csv.writer(some_file, dialect=MyDialect())
.
As far as I can tell, the stub is technically correct, but _csv.writer
should be able to take subclasses of csv.writer
. (Or at least I assume that's the intention. Notably, _csv.Dialect
has a strict
attribute that csv.Dialect
lacks.)