Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Dev
Re: an alternative to embedding policy in PEP 418 (was: PEP 418: Add monotonic clock)
 

Index | Next | Previous | View Flat


phd at phdru

Apr 4, 2012, 10:44 AM


Views: 439
Permalink
Re: an alternative to embedding policy in PEP 418 (was: PEP 418: Add monotonic clock) [In reply to]

On Wed, Apr 04, 2012 at 05:47:16PM +0200, Lennart Regebro wrote:
> On Tue, Apr 3, 2012 at 18:07, Ethan Furman <ethan [at] stoneleaf> wrote:
> > What's unclear about returning None if no clocks match?
>
> Nothing, but having to check error values on return functions are not
> what you typically do in Python. Usually, Python functions that fail
> raise an error.

Absolutely. "Errors should never pass silently."

> Please don't force Python users to write pseudo-C code in Python.

+1. Pythonic equivalent of "get_clock(THIS) or get_clok(THAT)" is

for flag in (THIS, THAT):
try:
clock = get_clock(flag)
except:
pass
else:
break
else:
raise ValueError('Cannot get clock, tried THIS and THAT')

Oleg.
--
Oleg Broytman http://phdru.name/ phd [at] phdru
Programmers don't die, they just GOSUB without RETURN.
_______________________________________________
Python-Dev mailing list
Python-Dev [at] python
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/list-python-dev%40lists.gossamer-threads.com

Subject User Time
an alternative to embedding policy in PEP 418 (was: PEP 418: Add monotonic clock) cs at zip Apr 1, 2012, 5:43 PM
    Re: an alternative to embedding policy in PEP 418 (was: PEP 418: Add monotonic clock) victor.stinner at gmail Apr 2, 2012, 4:37 AM
    Re: an alternative to embedding policy in PEP 418 (was: PEP 418: Add monotonic clock) cs at zip Apr 2, 2012, 2:38 PM
        Re: an alternative to embedding policy in PEP 418 (was: PEP 418: Add monotonic clock) cs at zip Apr 2, 2012, 2:51 PM
            Re: an alternative to embedding policy in PEP 418 (was: PEP 418: Add monotonic clock) cs at zip Apr 2, 2012, 3:05 PM
        Re: an alternative to embedding policy in PEP 418 (was: PEP 418: Add monotonic clock) cs at zip Apr 2, 2012, 3:44 PM
        Re: an alternative to embedding policy in PEP 418 (was: PEP 418: Add monotonic clock) regebro at gmail Apr 2, 2012, 10:51 PM
        Re: an alternative to embedding policy in PEP 418 (was: PEP 418: Add monotonic clock) victor.stinner at gmail Apr 3, 2012, 4:45 PM
    Re: an alternative to embedding policy in PEP 418 (was: PEP 418: Add monotonic clock) cs at zip Apr 2, 2012, 11:03 PM
        Re: an alternative to embedding policy in PEP 418 (was: PEP 418: Add monotonic clock) breamoreboy at yahoo Apr 3, 2012, 1:03 AM
            Re: an alternative to embedding policy in PEP 418 (was: PEP 418: Add monotonic clock) cs at zip Apr 3, 2012, 1:43 AM
                Re: an alternative to embedding policy in PEP 418 (was: PEP 418: Add monotonic clock) greg.ewing at canterbury Apr 3, 2012, 5:04 PM
                    Re: an alternative to embedding policy in PEP 418 (was: PEP 418: Add monotonic clock) breamoreboy at yahoo Apr 3, 2012, 5:18 PM
        Re: an alternative to embedding policy in PEP 418 (was: PEP 418: Add monotonic clock) regebro at gmail Apr 3, 2012, 7:09 AM
    Re: an alternative to embedding policy in PEP 418 (was: PEP 418: Add monotonic clock) ethan at stoneleaf Apr 3, 2012, 9:07 AM
        Re: an alternative to embedding policy in PEP 418 (was: PEP 418: Add monotonic clock) cs at zip Apr 3, 2012, 2:42 PM
            Re: an alternative to embedding policy in PEP 418 (was: PEP 418: Add monotonic clock) ethan at stoneleaf Apr 3, 2012, 3:08 PM
                Re: an alternative to embedding policy in PEP 418 (was: PEP 418: Add monotonic clock) cs at zip Apr 3, 2012, 4:38 PM
                    Re: an alternative to embedding policy in PEP 418 (was: PEP 418: Add monotonic clock) ncoghlan at gmail Apr 3, 2012, 4:46 PM
        Re: an alternative to embedding policy in PEP 418 (was: PEP 418: Add monotonic clock) regebro at gmail Apr 4, 2012, 8:47 AM
    Re: an alternative to embedding policy in PEP 418 (was: PEP 418: Add monotonic clock) cs at zip Apr 3, 2012, 7:46 PM
    Re: an alternative to embedding policy in PEP 418 (was: PEP 418: Add monotonic clock) p.f.moore at gmail Apr 4, 2012, 1:21 AM
    Re: an alternative to embedding policy in PEP 418 (was: PEP 418: Add monotonic clock) ethan at stoneleaf Apr 4, 2012, 9:18 AM
        Re: an alternative to embedding policy in PEP 418 (was: PEP 418: Add monotonic clock) g.brandl at gmx Apr 4, 2012, 10:47 AM
            Re: an alternative to embedding policy in PEP 418 (was: PEP 418: Add monotonic clock) ethan at stoneleaf Apr 4, 2012, 11:06 AM
            Re: an alternative to embedding policy in PEP 418 (was: PEP 418: Add monotonic clock) cs at zip Apr 4, 2012, 3:06 PM
    Re: an alternative to embedding policy in PEP 418 (was: PEP 418: Add monotonic clock) phd at phdru Apr 4, 2012, 10:44 AM
        Re: an alternative to embedding policy in PEP 418 (was: PEP 418: Add monotonic clock) ethan at stoneleaf Apr 4, 2012, 11:03 AM
            Re: an alternative to embedding policy in PEP 418 (was: PEP 418: Add monotonic clock) phd at phdru Apr 4, 2012, 12:24 PM
                Re: an alternative to embedding policy in PEP 418 (was: PEP 418: Add monotonic clock) ethan at stoneleaf Apr 4, 2012, 12:52 PM
                    Re: an alternative to embedding policy in PEP 418 (was: PEP 418: Add monotonic clock) phd at phdru Apr 4, 2012, 4:05 PM
                        Re: an alternative to embedding policy in PEP 418 (was: PEP 418: Add monotonic clock) stephen at xemacs Apr 5, 2012, 6:06 AM
                        Re: an alternative to embedding policy in PEP 418 (was: PEP 418: Add monotonic clock) ethan at stoneleaf Apr 5, 2012, 11:56 AM
                            Re: an alternative to embedding policy in PEP 418 (was: PEP 418: Add monotonic clock) phd at phdru Apr 5, 2012, 1:15 PM
                                Re: an alternative to embedding policy in PEP 418 (was: PEP 418: Add monotonic clock) ethan at stoneleaf Apr 5, 2012, 1:49 PM
                                Re: an alternative to embedding policy in PEP 418 (was: PEP 418: Add monotonic clock) cs at zip Apr 5, 2012, 3:08 PM
                        Re: an alternative to embedding policy in PEP 418 (was: PEP 418: Add monotonic clock) cs at zip Apr 5, 2012, 3:05 PM
                Re: an alternative to embedding policy in PEP 418 steve at pearwood Apr 4, 2012, 3:50 PM
                    Re: an alternative to embedding policy in PEP 418 cs at zip Apr 4, 2012, 4:14 PM
                        Re: an alternative to embedding policy in PEP 418 steve at pearwood Apr 6, 2012, 3:25 AM
                            Re: an alternative to embedding policy in PEP 418 cs at zip Apr 6, 2012, 4:11 PM
                                Re: an alternative to embedding policy in PEP 418 v+python at g Apr 6, 2012, 5:30 PM
                                    Re: an alternative to embedding policy in PEP 418 cs at zip Apr 6, 2012, 9:22 PM
    Re: an alternative to embedding policy in PEP 418 (was: PEP 418: Add monotonic clock) phd at phdru Apr 5, 2012, 6:34 AM
        Re: an alternative to embedding policy in PEP 418 (was: PEP 418: Add monotonic clock) stephen at xemacs Apr 5, 2012, 7:45 AM
    Re: an alternative to embedding policy in PEP 418 (was: PEP 418: Add monotonic clock) phd at phdru Apr 5, 2012, 8:22 AM
        Re: an alternative to embedding policy in PEP 418 (was: PEP 418: Add monotonic clock) rdmurray at bitdance Apr 5, 2012, 8:38 AM
            Re: an alternative to embedding policy in PEP 418 (was: PEP 418: Add monotonic clock) phd at phdru Apr 5, 2012, 9:02 AM
        Re: an alternative to embedding policy in PEP 418 (was: PEP 418: Add monotonic clock) phd at phdru Apr 5, 2012, 9:01 AM
        Re: an alternative to embedding policy in PEP 418 (was: PEP 418: Add monotonic clock) stephen at xemacs Apr 5, 2012, 7:57 PM
    Re: an alternative to embedding policy in PEP 418 (was: PEP 418: Add monotonic clock) murman at gmail Apr 6, 2012, 4:31 AM

  Index | Next | Previous | View Flat
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.