Skip to content

Commit

Permalink
Fix doc bug w/ one(default=Exception)
Browse files Browse the repository at this point in the history
  • Loading branch information
chadwhitacre committed Mar 1, 2014
1 parent 55c69c0 commit 935feba
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion postgres/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,14 +379,15 @@ def one(self, sql, parameters=None, default=None, back_as=None, *a, **kw):
:param string sql: the SQL statement to execute
:param parameters: the `bind parameters`_ for the SQL statement
:type parameters: dict or tuple
:param default: the value to return if no results are found
:param default: the value to return or raise if no results are found
:param back_as: the type of record to return
:type back_as: type or string
:param a: passed through to :py:meth:`~postgres.Postgres.get_cursor`
:param kw: passed through to :py:meth:`~postgres.Postgres.get_cursor`
:returns: a single record or value or the value of the
:py:attr:`default` argument
:raises: :py:exc:`~postgres.TooFew` or :py:exc:`~postgres.TooMany`
or `default` (if `default` is an `Exception` subclass or instance)
.. _bind parameters: #bind-parameters
Expand Down

2 comments on commit 935feba

@zbynekwinkler
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the default should never be raised. Instead another param called maybe raises should be added to make it clear at the call site that the function raises.

@chadwhitacre
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zwn Ticketed as #38. Let's discuss there instead of on this commit.

Please sign in to comment.