topmark.filetypes.factory¶
Factories for creating FileType instances.
This module centralizes small helpers that build FileType objects with sensible
defaults and a clear identity model.
Rationale
FileTypeidentity is (namespace, local_key).- TopMark reserves the namespace
TOPMARK_NAMESPACEfor built-in file types. - Call sites should not repeat boilerplate such as converting
Noneto empty lists.
The helpers here are intentionally lightweight and side-effect free: they return
FileType instances but do not register them.
make_filetype_factory ¶
Return a FileType constructor that pre-binds a namespace.
This is useful for plugin authors and internal topical modules that want to
define multiple file types in the same namespace without repeating the
namespace=... argument.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
namespace
|
str
|
The namespace to assign to all constructed |
required |
Returns:
| Type | Description |
|---|---|
Callable[..., FileType]
|
A callable with the same keyword-only parameters as |
Callable[..., FileType]
|
except that |
Notes
This helper does not register the file type; it only constructs it. Registration happens when file types are loaded into a registry.