Skip to content

Commit

Permalink
docs and a pylint fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
cgranade committed Apr 20, 2017
1 parent b5fdc5a commit 8a89bf8
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 9 deletions.
12 changes: 12 additions & 0 deletions doc/source/devguide/util_fns.rst
Original file line number Diff line number Diff line change
Expand Up @@ -183,3 +183,15 @@ String Property
.. autofunction:: string_property


Named Structures
================

The :class:`~instruments.named_struct.NamedStruct` class can be used to represent
C-style structures for serializing and deserializing data.

.. autoclass:: instruments.named_struct.NamedStruct

.. autoclass:: instruments.named_struct.Field

.. autoclass:: instruments.named_struct.Padding

17 changes: 8 additions & 9 deletions instruments/named_struct.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,16 @@
from future.utils import with_metaclass

# DESIGN NOTES ################################################################
"""
This class uses the Django-like strategy described at
http://stackoverflow.com/a/3288988/267841
to assign a "birthday" to each Field as it's instantiated. We can thus sort
each Field in a NamedStruct by its birthday.

Notably, this hack is not at all required on Python 3.6:
https://www.python.org/dev/peps/pep-0520/
# This class uses the Django-like strategy described at
# http://stackoverflow.com/a/3288988/267841
# to assign a "birthday" to each Field as it's instantiated. We can thus sort
# each Field in a NamedStruct by its birthday.

TODO: arrays other than string arrays do not currently work.
"""
# Notably, this hack is not at all required on Python 3.6:
# https://www.python.org/dev/peps/pep-0520/

# TODO: arrays other than string arrays do not currently work.

# PYLINT CONFIGURATION ########################################################

Expand Down

0 comments on commit 8a89bf8

Please sign in to comment.