Serial Ports Context Manager
<p>Is the following a reasonable approach?</p>

<pre><code>with SerialPorts() as serial_ports:
    in= SerialPort("COM1")
    serial_ports.add(in)
    out = SerialPort("COM2")
    serial_ports.add(out)

    # use in and out
</code></pre>

<p>where <code>SerialPorts</code> and <code>SerialPort</code> implement the context manager interface.</p>

<p><code>SerialPorts.exit()</code> loops through the added serial ports calling their <code>exit()</code>. <code>SerialPort</code>'s <code>exit()</code> closes the serial port.</p>

<p>Is there a better way of doing this?</p>
