It's possible to create a subclass of
Dialect
, or build a new dialect directly via keyword arguments to theregister_dialect
function of the csv module. It's generally quicker to use theregister_dialect
approach. However, supporting the former simply means defining a few extra attributes. That's useful if you already have data encapsulated in a class.Consider a comma-separated value that contains a comma! The
split
method will return two values here instead of one. This is where the quoting logic within the csv module pays off.They're not. Formulas are spreadsheet concepts that do not carry over into plain text.
This is because we read in a text source to begin with and do not perform any integer casting or type conversion.
Generally speaking, no. There are other methods that can be used for Object Serialization, such as the
pickle
module. Complex structures are not saved out. JSON is usually best suited for data transfer rather than object serialization or marshalling.Because of its small size. XML includes a lot of markup and tag structure, whereas JSON does not.