From d66c831de2c1ba51fd8baf04161d5900ffa64e27 Mon Sep 17 00:00:00 2001 From: Tyrell Verley Date: Mon, 25 Nov 2024 08:31:45 -0700 Subject: [PATCH] Added type hints to LayerFieldsContainer class for consistency (matching LayerField class). --- src/pyshark/packet/fields.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pyshark/packet/fields.py b/src/pyshark/packet/fields.py index a59e4efd..428fe69b 100644 --- a/src/pyshark/packet/fields.py +++ b/src/pyshark/packet/fields.py @@ -94,20 +94,20 @@ def __new__(cls, main_field, *args, **kwargs): def __dir__(self): return dir(type(self)) + list(self.__dict__.keys()) + dir(self.main_field) - def add_field(self, field): + def add_field(self, field) -> None: self.fields.append(field) @property - def all_fields(self): + def all_fields(self) -> list: """Returns all fields in a list, the main field followed by the alternate fields.""" return self.fields @property - def main_field(self): + def main_field(self) -> LayerField: return self.fields[0] @property - def alternate_fields(self): + def alternate_fields(self) -> list: """Return the alternate values of this field containers (non-main ones).""" return self.fields[1:]