Add a variable to a class instance at runtime: Difference between revisions

Content added Content deleted
Line 595: Line 595:
For special situations, such as when parsing an input file, where new data type names
For special situations, such as when parsing an input file, where new data type names
may be appropriate, this can be accommodated using a Dict as one of the class variables.
may be appropriate, this can be accommodated using a Dict as one of the class variables.
For example, consider the below SOAP input data for a program processing phone numbers,
For example, consider the below JSON input data for a program processing phone numbers,
where the type of phone numbers for the person is unknown until run-time:
where the type of phone numbers for the person is unknown until run-time:
<lang xml>
<lang xml>