You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is no easy way to get a CSV dialect that differs from an existing one in a single formatting parameter. You either repeat all parameters in a csv.Dialect subclass, or pass the individual parameters to csv.reader()/csv.writer() at every call site.
I propose to support copy.replace() for dialects — both instances of csv.Dialect subclasses and the dialect objects returned by csv.get_dialect().
Parameters that are not replaced are inherited from the original dialect, and the result is validated like a newly created dialect.
Note that some parameters depend on each other and may need to be replaced together. For example, replacing quotechar with None also requires replacing quoting with QUOTE_NONE, otherwise validation fails with "quotechar must be set if quoting enabled".
Activity
gh-155033: Support copy.replace() for csv dialects (GH-155035)
pythongh-155033: Support copy.replace() for csv dialects (pythonGH-15…