KimiNewt/pyshark — pull request #46 by KimiNewt (2014-11-01 13:57:44+00:00)
Title: Field objects (solving multiple fields of same name issue)

This pull-request solves the issue of multiple fields under the same name by introducing a new class: FieldsContainer, which is a class which acts as a string but in fact holds the values of multiple fields.

As such, it is completely backwards compatible with earlier code, but can be used to access alternate fields in a fairly easy way:

```python
>>> p.ip.addr
10.0.0.1
>>> isinstance(p.ip.addr, str)
True
>>> p.ip.addr.alternate_fields
[] # Shows the other fields with the same name
```

It also allows easier access of previously harder-to-access fields, such as:

```python
>>> p.ip.addr.showname
Source or Destination Address: 10.0.0.10 (10.0.0.10)
# And some new attributes as well:
>>> p.ip.addr.int_value
167772170
>>> p.ip.addr.binary_value
'\n\x00\x00\n'
```

This solves long-standing issues #15 & #23 and replaces pull-requests #16 & #17 .

Before merging, I wanted to know from the issuers and any others of any opinion as for this solution's implementation. It also requires documentation, testing and possibly modifications for python3 (not tested thoroughly, but it seems the current tests pass).