From b053d5d5f376a5fb4b06d35d717f7a7e8ce71263 Mon Sep 17 00:00:00 2001 From: Robert Smallshire Date: Sun, 14 Jun 2015 20:22:47 +0200 Subject: [PATCH] Makes documentation consistent with implementation. --- segpy/header.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/segpy/header.py b/segpy/header.py index 82a9f01..6efbeb0 100644 --- a/segpy/header.py +++ b/segpy/header.py @@ -146,11 +146,12 @@ class SubFormatMeta(FormatMeta): SubFormat classes must be declared as: - class MySubFormat(metaclass=SubFormatMeta, - format_class=MyFormatClass, - field_names=['first_field_name', - 'second_field_name']) - pass + class MySubFormat(metaclass=SubFormatMeta, + parent_format=MyFormatClass, + parent_field_names=[ + 'first_field_name', + 'second_field_name']): + pass """ def __new__(mcs, name, bases, namespace, parent_format, parent_field_names): @@ -160,14 +161,12 @@ class SubFormatMeta(FormatMeta): bases: The base classes of the actual class. parent_format: An existing Format (?Header) on which (sort out terminology here) of which this format has a subset of fields. - field_names: An iterable series of field names which this format should + parent_field_names: An iterable series of field names which this format should duplicate from the parent_format. """ - # TODO: We need an inheritance aware getattr for class attributes! # Copy the requested fields, by creating a new descriptor based # on information retrieved from the existing descriptor - for field_name in parent_field_names: named_field = getattr(parent_format, field_name) assert named_field.name == field_name