Ticket #4474 enhancement closed fixed

Opened 3 years ago

Last modified 3 years ago

ListOf AMP Arguments should support 'optional' flag

Reported by: faldridge Owned by:
Priority: normal Milestone:
Component: core Keywords:
Cc: Branch:
Author: Launchpad Bug:

Description

Like all other AMP Argument subclasses, t.p.amp.ListOf should allow callers to pass 'optional=True' to its init() method, thereby allowing the argument to be omitted from the protocol.

Attached is a patch that provides the correct behavior with the necessary update to ListOf's docstring.

As the functionality is handled by the base class (t.p.amp.Argument), and not individual subclasses, and as the functionality already has unit tests, there are no unit tests included in this patch.

Attachments

listof-optional-4474.patch Download (3.1 KB) - added by faldridge 3 years ago.

Change History

1

follow-up: ↓ 2   Changed 3 years ago by exarkun

  • owner changed from glyph to faldridge
  • keywords review removed

The patch looks good. Thanks. A couple things though:

  1. In @foo docs, after the first line, lines should be indented 4 spaces.
  2. The feature should have unit tests.

Changed 3 years ago by faldridge

2

in reply to: ↑ 1   Changed 3 years ago by faldridge

  • keywords review added
  • owner changed from faldridge to exarkun

Replying to exarkun:

The patch looks good. Thanks. A couple things though: 1. In @foo docs, after the first line, lines should be indented 4 spaces. 2. The feature should have unit tests.

1. Done. 2. Added.

3

  Changed 3 years ago by exarkun

  • keywords review removed

Thanks, looks good, I'll apply (including a news fragment).

4

  Changed 3 years ago by exarkun

  • status changed from new to closed
  • resolution set to fixed

(In [29159]) Add optional parameter to twisted.protocols.amp.ListOf

Author: faldridge Reviewer: exarkun Fixes: #4474

Let ListOf arguments be optional in the usual way.

5

  Changed 2 years ago by <automation>

  • owner exarkun deleted
Note: See TracTickets for help on using tickets.