Skip to content

Commit

Permalink
Computed docstring fixed.
Browse files Browse the repository at this point in the history
  • Loading branch information
arekbulski committed Aug 30, 2016
1 parent 2284fe0 commit 5af5c63
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions construct/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1213,10 +1213,10 @@ def _sizeof(self, context):
return 0

class Computed(Construct):
"""
r"""
A computed value.
Underlying byte stream is unaffected. When parsing `func(context)` provides the value, building is noop.
Underlying byte stream is unaffected. When parsing `func(context)` provides the value.
:param name: the name of the value
:param func: a function that takes the context and return the computed value
Expand All @@ -1229,8 +1229,8 @@ class Computed(Construct):
Computed("total", lambda ctx: ctx.width * ctx.height),
)
foo.parse(b'\x05\x05') -> Container(width=5,height=5,total=25)
foo.build(Container(width=5,height=5,total=25)) -> b'\x05\x05'
foo.parse(b'\x04\x05') -> Container(width=4,height=5,total=20)
foo.build(Container(width=4,height=5,total=20)) -> b'\x04\x05'
"""
__slots__ = ["func"]
def __init__(self, name, func):
Expand Down

0 comments on commit 5af5c63

Please sign in to comment.