Checking function's parameters (type, value) or not ?
Chris Angelico
rosuav at gmail.com
Wed Apr 6 14:38:28 EDT 2016
On Thu, Apr 7, 2016 at 3:36 AM, Michael Selik <michael.selik at gmail.com> wrote:
> However, you might want to protect them from a subtle infinite loop or other traps that are tough to recover from. If it's an obvious infinity, well, that's their own fault. For example, ``range`` stops you from a zero step-size, but won't stop you from ``range(int(1e200))``.
>
>>> range(int(1e200))
range(0, 99999999999999996973312221251036165947450327545502362648241750950346848435554075534196338404706251868027512415973882408182135734368278484639385041047239877871023591066789981811181813306167128854888448)
Looks fine to me :)
ChrisA
More information about the Python-list
mailing list