Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Doctests are formatted in just the same way as you would run an interactive session. You can run an interactive session and just copy it and you'll get all the results. This might be one valid session:</p> <pre><code>&gt;&gt;&gt; import datetime &gt;&gt;&gt; print Manager(10, 'Bob', 'Quux', '123', datetime.datetime(2009, 1, 1), ... ['Michael', 'Bob', 'Hello']) 10, Bob Quux, 123, 0001-01-01 00:00:00, 2009-01-01 00:00:00, Michael, Bob, Hello &gt;&gt;&gt; print Manager(2000, 'Bob', 'Lol', '1234', datetime.datetime(2009, 1, 1), ... ['Michael', 'Bob', 'Hello']) 2000, Bob Lol, 1234, 0001-01-01 00:00:00, 2009-01-01 00:00:00 </code></pre> <p>There were assorted syntax errors in what you had done;</p> <ul> <li>For the doctest part of it, if you're continuing the statement, the next line must start with <code>...&nbsp;</code> (exactly the same as in a regular session);</li> <li>Your <code>Manager</code> instantiation was invalid (genuine Python <code>SyntaxError</code>) as you had <code>startDate=...</code> (a keyword argument) followed by a non-keyword argument (the value for "manager"). This is the main problem that stopped it from running. And that's also what the exception told you.</li> </ul> <p>If you can't figure it out in a doctest, <em>run it in a normal Python session</em>. Play with it there.</p> <p>There are also a number of other significant problems in your code; here are a couple of them:</p> <ul> <li><code>EmpSalaried</code> versus <code>Employee</code>: what gives with that?</li> <li>Due to using a mutable default argument, if you don't specify the <code>manage</code> argument when creating a <code>Manager</code>, they will get the same list. This is not what you want.</li> </ul>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload