{"id":24512,"library":"recordtype","title":"recordtype","description":"Provides a mutable alternative to namedtuple. Users define a class with fields and get a mutable, tuple-like object with named attributes. Last stable version is 1.4, released in 2012. No active development, but still usable. Use with caution in new projects.","status":"maintenance","version":"1.4","language":"python","source_language":"en","source_url":"https://github.com/lgautier/recordtype","tags":["namedtuple","mutable","deprecated","simple"],"install":[{"cmd":"pip install recordtype","lang":"bash","label":"Install via pip"}],"dependencies":[],"imports":[{"note":"Direct import recordtype is not a class; it's a module. Must import the class.","wrong":"import recordtype","symbol":"recordtype","correct":"from recordtype import recordtype"}],"quickstart":{"code":"from recordtype import recordtype\n\n# Define a record type\nPerson = recordtype('Person', 'name age email')\np = Person('Alice', 30, 'alice@example.com')\nprint(p.name)  # Alice\np.age = 31     # mutable\nprint(p.age)   # 31\n","lang":"python","description":"Creates a mutable record type with named fields."},"warnings":[{"fix":"Use from dataclasses import dataclass and define a class with fields.","message":"recordtype has been unmaintained since 2012. Consider using types.SimpleNamespace, dataclasses, or attrs for new projects.","severity":"deprecated","affected_versions":"all"},{"fix":"Always use a space-separated string: recordtype('Name', 'field1 field2 field3').","message":"Field names are specified as a single string with spaces. It's easy to accidentally use commas or other delimiters.","severity":"gotcha","affected_versions":"all"},{"fix":"Consider using dataclasses with type annotations if you need type safety.","message":"recordtype does not support type hints or validation. Field values can be any type and are not checked.","severity":"gotcha","affected_versions":"all"},{"fix":"If you need pickle, implement __reduce__ manually or switch to a different library.","message":"recordtype returns an object that is not compatible with some pickle protocols due to its internal _fields attribute.","severity":"breaking","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use: from recordtype import recordtype","cause":"Importing recordtype incorrectly: import recordtype instead of from recordtype import recordtype.","error":"AttributeError: module 'recordtype' has no attribute 'recordtype'"},{"fix":"Pass field names as a string: recordtype('Person', 'name age')","cause":"Providing field names as a list or tuple instead of a single space-separated string.","error":"TypeError: __new__() missing 1 required positional argument: '...'"},{"fix":"Access fields by name, not by unpacking. If unpacking is needed, consider namedtuple or dataclasses.","cause":"recordtype does not support tuple unpacking because it is not a tuple subclass.","error":"TypeError: cannot unpack non-iterable Person object"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}