Raising error or returning None I have a method poker defined as below:

def poker(hands):
'''Returns the best hand from a list of hands.

    Parameters:
        hands: list

    Example:
        poker(hands) =&gt; hands
'''
    return max(hands, key=hand_rank)


As mentioned in the docstrings, this function returns the best hand from a list of hands. 
The issue I am facing is while passing an empty list of hands to this function. Hypothetically and for greater coverage, I want to add such a test case.   

Should I raise an error or should I return None object ?

Generally, how do I decide where an error should be raised and where should it not?
There is no universal rule and this particular decision is use-case specific. Note that there are other options as well, like returning -1 for an empty list.

If we consider that max() naturally does not work with empty sequences:

In [1]: max([])
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
&lt;ipython-input-4-8d2766aecf92&gt; in &lt;module&gt;()
----&gt; 1 max([])

ValueError: max() arg is an empty sequence


Then, throwing an error makes more sense in this particular situation. If you do so, you can empower your docstring with a doctest:

def poker(hands):
    """
    Returns the best hand from a list of hands.

        Parameters:
            hands: list

        Example:
            poker(hands) =&gt; hands

    Raises a ValueError in case of empty list of hands:

    &gt;&gt;&gt; poker([])
    Traceback (most recent call last):
      ...
    ValueError: Empty list of hands.
    """
    if not hands:
        raise ValueError("Empty list of hands.")

    return max(hands, key=hand_rank)