type_bridge.attribute.integer¶
integer
¶
Integer attribute type for TypeDB.
Integer
¶
Bases: NumericAttribute
Integer attribute type that accepts int values.
Example
class Age(Integer): pass
class Count(Integer): pass
With Literal for type safety¶
class Priority(Integer): pass
priority: Literal[1, 2, 3] | Priority
Initialize Integer attribute with an integer value.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
int
|
The integer value to store |
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
If value violates range_constraint |