.. This file is part of Sympathy for Data. .. Copyright (c) 2020 Combine Control Systems AB .. .. Sympathy for Data is free software: you can redistribute it and/or modify .. it under the terms of the GNU General Public License as published by .. the Free Software Foundation, version 3 of the License. .. .. Sympathy for Data is distributed in the hope that it will be useful, .. but WITHOUT ANY WARRANTY; without even the implied warranty of .. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the .. GNU General Public License for more details. .. .. You should have received a copy of the GNU General Public License .. along with Sympathy for Data. If not, see . .. _recordapi: syrecord API ============ syrecord is the builtin datatype in sympathy used for representing records. A record is an container type of named elements whose the elements can be of different types. For example, (x:table, y:text) is the data type for a two element record representing a pair of a table and a text; the table being named x and the text y. If the port type of a node contains (:,) the resulting port will contain record type data. .. class:: syrecord(container_type) Container type, for example, ``sympathy.api.types.from_string('(x:table, y:text)')``, this determines the type of content allowed. Note that container type includes the type of the record itself. .. method:: create() Return a new syrecord, not connected to any file. The same container type is used for the new syrecord. .. method:: source(other, shallow=False): Fill with elements from other syrecord. .. method:: __copy__(): Return a shallow copy. .. method:: __deepcopy__(memo=None): Return a deep copy. .. method:: __getattr__(name): Return named item. .. method:: __setattr__(name, item): Set named item. .. method:: __iter__(self): Return iterator of item names. .. method:: __repr__(self): Return string representation.