A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2011-June/111819.html below:

[Python-Dev] [Python-checkins] cpython: Issue #12040: Expose a new attribute `sentinel` on instances of

[Python-Dev] [Python-checkins] cpython: Issue #12040: Expose a new attribute `sentinel` on instances of [Python-Dev] [Python-checkins] cpython: Issue #12040: Expose a new attribute `sentinel` on instances ofNick Coghlan ncoghlan at gmail.com
Tue Jun 7 04:47:37 CEST 2011
On Tue, Jun 7, 2011 at 3:36 AM, antoine.pitrou
<python-checkins at python.org> wrote:
> +    @property
> +    def sentinel(self):
> +        '''
> +        Return a file descriptor (Unix) or handle (Windows) suitable for
> +        waiting for process termination.
> +        '''
> +        try:
> +            return self._sentinel
> +        except AttributeError:
> +            raise ValueError("process not started")
> +

We should probably follow this model for threading.Thread.ident as
well (i.e. throwing an exception rather than returning None if the
thread hasn't been started yet).

Also, for runtime state errors, we tend to use RuntimeError rather
than ValueError (e.g. see the errors thrown by
contextlib._GeneratorContextManager)

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4