Author serhiy.storchaka
Recipients Arfrever, Giovanni.Bajo, PaulMcMillan, ReneSac, Vlado.Boza, alex, arigo, benjamin.peterson, camara, christian.heimes, cvrebert, dmalcolm, gregory.p.smith, haypo, koniiiik, lemburg, mark.dickinson, sbermeister, serhiy.storchaka, Łukasz.Rekucki
Date 2012-11-30.21:27:24
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <201211302327.11422.storchaka@gmail.com>
In-reply-to <50B91853.8050206@egenix.com>
Content
> try:
>     mapping = {}
>     mapping.max_collisions = 100
>     mapping.update(source)
> except CollisionLimitError:
>     return 'no thank you'

May be use a more general solution?

try:
    with run_with_timeout(timeout=100, timer=collisions_count):
        mapping = insert_untrusted_data(source)
except TimeoutError:
    return 'no thank you'

(You can can use different measurement for timeout: user time, real time, ticks 
count, collisions count, or even a user defined timer).
History
Date User Action Args
2012-11-30 21:27:24serhiy.storchakasetrecipients: + serhiy.storchaka, lemburg, arigo, gregory.p.smith, mark.dickinson, haypo, christian.heimes, benjamin.peterson, Arfrever, alex, cvrebert, dmalcolm, Giovanni.Bajo, PaulMcMillan, Vlado.Boza, koniiiik, sbermeister, camara, Łukasz.Rekucki, ReneSac
2012-11-30 21:27:24serhiy.storchakalinkissue14621 messages
2012-11-30 21:27:24serhiy.storchakacreate