Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder7.xlned.com!newsfeed.xs4all.nl!newsfeed4a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.004 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'matches': 0.07; 'string': 0.09; 'falls': 0.09; 'subject:language': 0.09; 'subject:string': 0.09; 'random': 0.14; 'template': 0.14; 'mode,': 0.16; 'randoms': 0.16; 'subject:generation': 0.16; 'subject:random': 0.16; 'wrote:': 0.18; 'aug': 0.22; 'tests': 0.22; 'paul': 0.24; 'source': 0.25; 'pass': 0.26; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; 'invoke': 0.31; 'class': 0.32; 'fri,': 0.33; 'received:google.com': 0.35; 'object,': 0.36; 'unit': 0.37; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'simple': 0.61; 'back': 0.62; 'improvement': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=CKd7P5GEljzXHkbaURMyHlRJ5qXNig/aOcgCqPO2KCA=; b=QsLa6a03gL88mhm2yR1XQs+cNdIFyrcjI3DaOYr1KqajTc8t94Tf7BAIhfNLuVxw8R UzWyzhP0YirHbwRJJqDQKxYC9lwuW3fmUjObo5Tz3zMZeJpKVG5dOiIUN9BrEXLLaT+T j+viEXoHWkh0ATBLd+SifGDkFsPpQRClQBVXF1yiyoCKtGgsEIf/bIm9LWLlu83514pA eYGoog+yKl4F+WuC23qDWgqZla49C2E4H2BZ8TlzL88vkUcNp3AiHnFuFgTMhG7PVy17 wIRkoN6V0f94w3DQOexrRZaAjRaouaz/B0sk6sUedVoVUpdUDXS3Ojunm0GEnVCXT8++ yjSg== X-Received: by 10.68.103.165 with SMTP id fx5mr26880365pbb.118.1407535438671; Fri, 08 Aug 2014 15:03:58 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <14d94692-2257-4dfb-a82f-f1674a839233@googlegroups.com> References: <14d94692-2257-4dfb-a82f-f1674a839233@googlegroups.com> From: Ian Kelly Date: Fri, 8 Aug 2014 16:03:18 -0600 Subject: Re: Template language for random string generation To: Python Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 11 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1407535446 news.xs4all.nl 2934 [2001:888:2000:d::a6]:54891 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:75909 On Fri, Aug 8, 2014 at 3:01 AM, Paul Wolf wrote: > * Uses SystemRandom class (if available, or falls back to Random) A simple improvement would be to also allow the user to pass in a Random object, in case they have their own source of randomness they want to use, or for fake Randoms used for writing unit tests that invoke strgen. Have you given any thought to adding a validation mode, where the user provides a template and a string and wants to know if the string matches the template?