# libtmux._internal.dataclasses.SkipDefaultFieldsReprMixin

- **Module:** libtmux._internal.dataclasses
- **Package:** libtmux
- **Language:** Python
- **Kind:** class
- **Source:** https://github.com/tmux-python/libtmux/blob/036c521c4b83ce6e434eb50afe2a0d08a6a05e46/src/libtmux/_internal/dataclasses.py#L18
- **Page:** https://libtmux.org/reference/py/libtmux-_internal-dataclasses-skipdefaultfieldsreprmixin/

Skip default fields in :func:`~dataclasses.dataclass` object representation.

## Example

```python
>>> @dataclasses.dataclass()
... class Item:
...     name: str
...     unit_price: float = 1.00
...     quantity_on_hand: int = 0
...
```

## Example

```python
>>> @dataclasses.dataclass(repr=False)
... class ItemWithMixin(SkipDefaultFieldsReprMixin):
...     name: str
...     unit_price: float = 1.00
...     quantity_on_hand: int = 0
...
```

## Example

```python
>>> Item('Test')
Item(name='Test', unit_price=1.0, quantity_on_hand=0)
```

## Example

```python
>>> ItemWithMixin('Test')
ItemWithMixin(name=Test)
```

## Example

```python
>>> Item('Test', quantity_on_hand=2)
Item(name='Test', unit_price=1.0, quantity_on_hand=2)
```

## Example

```python
>>> ItemWithMixin('Test', quantity_on_hand=2)
ItemWithMixin(name=Test, quantity_on_hand=2)
```

## Example

If you want to copy/paste the :meth:`~.__repr__()` directly, you can omit the ``repr=False``:

```python
>>> @dataclasses.dataclass
... class ItemWithMixin(SkipDefaultFieldsReprMixin):
...     name: str
...     unit_price: float = 1.00
...     quantity_on_hand: int = 0
...     __repr__ = SkipDefaultFieldsReprMixin.__repr__
...
```

## Example

```python
>>> ItemWithMixin('Test')
ItemWithMixin(name=Test)
```

## Example

```python
>>> ItemWithMixin('Test', unit_price=2.00)
ItemWithMixin(name=Test, unit_price=2.0)
```

## Example

```python
>>> item = ItemWithMixin('Test')
>>> item.unit_price = 2.05
```

## Example

```python
>>> item
ItemWithMixin(name=Test, unit_price=2.05)
```

## Members

- `__repr__` (method) — Omit default fields in object representation.
