Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #76002

Re: Template language for random string generation

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!eternal-september.org!feeder.eternal-september.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed2a.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
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; 'literal': 0.09; 'subject:language': 0.09; 'subject:string': 0.09; 'cc:addr:python- list': 0.11; 'did,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'generator.': 0.16; 'personally,': 0.16; 'separated': 0.16; 'subject:generation': 0.16; 'subject:random': 0.16; 'trivially': 0.16; ':-)': 0.16; 'language': 0.16; 'wrote:': 0.18; 'split': 0.19; 'aug': 0.22; 'portion': 0.22; 'cc:addr:python.org': 0.22; 'text,': 0.24; 'mon,': 0.24; 'cc:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'specified': 0.30; 'message-id:@mail.gmail.com': 0.30; "d'aprano": 0.31; 'steven': 0.31; 'url:python': 0.33; 'something': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'google': 0.35; 'there': 0.35; 'really': 0.36; 'templates': 0.36; 'example,': 0.37; 'so,': 0.37; 'too': 0.37; 'two': 0.37; 'somebody': 0.38; 'either': 0.39; 'even': 0.60; "you're": 0.61; 'youtube': 0.65; 'to:none': 0.92
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=NLBbXrP9Wl+h672gHUZp4gJF9rWRg3PsrR+1RxDomQU=; b=iT4CLfVNqMBACPFQVk7EYiPKtpOAVarg8qF9YuwmTgPk7SfweBiM1/Ija/+JP0LOJh BasyCesBHQOVH/2P93scpiCa0TQBMHF5jl1M69cGoBIdcbvBv4CMWPWHEEfV5gBO+6W7 7dwKb6jOf05hz5EED8t3+krhRJZlE7v2OF2yaxus89G2MhEjkt27rKBDGpzqVAGv4f2d xHCSEhM5zeyGTCj0l7en51RZ+kMirCtJKfcRlffHRWRJ6WCi9qYBkcMh2qDhD0wLdNUW ZqJ4YC1vMITVhfOzUPDF0OxfQmySR40uLXi3p9qpZ/CrZPpLmT/O4HAnjCKW4oNQulyP pVwQ==
MIME-Version 1.0
X-Received by 10.42.216.148 with SMTP id hi20mr27020523icb.12.1407698756599; Sun, 10 Aug 2014 12:25:56 -0700 (PDT)
In-Reply-To <53e79e46$0$29967$c3e8da3$5496439d@news.astraweb.com>
References <14d94692-2257-4dfb-a82f-f1674a839233@googlegroups.com> <mailman.12817.1407674628.18130.python-list@python.org> <53e79e46$0$29967$c3e8da3$5496439d@news.astraweb.com>
Date Mon, 11 Aug 2014 05:25:56 +1000
Subject Re: Template language for random string generation
From Chris Angelico <rosuav@gmail.com>
Cc "python-list@python.org" <python-list@python.org>
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 <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.12826.1407698764.18130.python-list@python.org> (permalink)
Lines 21
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1407698764 news.xs4all.nl 2957 [2001:888:2000:d::a6]:48668
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:76002

Show key headers only | View raw


On Mon, Aug 11, 2014 at 2:31 AM, Steven D'Aprano
<steve+comp.lang.python@pearwood.info> wrote:
> Personally, I think even the OP's specified language is too complex. For
> example, it supports literal text, but given the use-case (password
> generators) do we really want to support templates like "password[\d]"? I
> don't think so, and if somebody did, they can trivially say "password" +
> SG('[\d]').render().

What if you're using this to generate IDs for something (think Youtube
video references), and you want to have an alphabetic portion and a
numeric portion separated by a hyphen? I think there is a use-case for
interior literal text, because otherwise you'd have to either split
the result or do two calls to the generator.

> Here, let me google that for you :-)
>
> https://duckduckgo.com/html/?q=python+crypto

Hehe. :)

ChrisA

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Template language for random string generation Paul Wolf <paulwolf333@gmail.com> - 2014-08-08 02:01 -0700
  Re: Template language for random string generation Chris Angelico <rosuav@gmail.com> - 2014-08-08 19:22 +1000
    Re: Template language for random string generation Paul Wolf <paulwolf333@gmail.com> - 2014-08-08 02:42 -0700
      Re: Template language for random string generation Ned Batchelder <ned@nedbatchelder.com> - 2014-08-08 07:20 -0400
        Re: Template language for random string generation Paul Wolf <paulwolf333@gmail.com> - 2014-08-08 06:02 -0700
      Re: Template language for random string generation Chris Angelico <rosuav@gmail.com> - 2014-08-08 21:29 +1000
        Re: Template language for random string generation Paul Wolf <paulwolf333@gmail.com> - 2014-08-08 06:03 -0700
  Re: Template language for random string generation Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-08-09 00:08 +1000
  Re: Template language for random string generation Skip Montanaro <skip@pobox.com> - 2014-08-08 09:35 -0500
    Re: Template language for random string generation cwolf.algo@gmail.com - 2014-08-08 11:43 -0700
      Re: Template language for random string generation Nick Cash <nick.cash@npcinternational.com> - 2014-08-08 20:28 +0000
  Re: Template language for random string generation Ian Kelly <ian.g.kelly@gmail.com> - 2014-08-08 16:03 -0600
    Re: Template language for random string generation Paul Wolf <paulwolf333@gmail.com> - 2014-08-08 23:52 -0700
      Re: Template language for random string generation Ian Kelly <ian.g.kelly@gmail.com> - 2014-08-09 01:49 -0600
      Re: Template language for random string generation Ian Kelly <ian.g.kelly@gmail.com> - 2014-08-09 01:57 -0600
  Re: Template language for random string generation Devin Jeanpierre <jeanpierreda@gmail.com> - 2014-08-10 05:43 -0700
    Re: Template language for random string generation Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-08-11 02:31 +1000
      Re: Template language for random string generation Devin Jeanpierre <jeanpierreda@gmail.com> - 2014-08-10 11:28 -0700
        Re: Template language for random string generation Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-08-11 12:22 +1000
          Re: Template language for random string generation Chris Angelico <rosuav@gmail.com> - 2014-08-11 12:31 +1000
          Re: Template language for random string generation Devin Jeanpierre <jeanpierreda@gmail.com> - 2014-08-11 00:01 -0700
      Re: Template language for random string generation Chris Angelico <rosuav@gmail.com> - 2014-08-11 05:25 +1000
      Re: Template language for random string generation Paul Wolf <paulwolf333@gmail.com> - 2014-08-10 22:06 -0700
        Re: Template language for random string generation Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-08-11 08:58 +0100
    Re: Template language for random string generation Paul Wolf <paulwolf333@gmail.com> - 2014-08-10 09:34 -0700
      Re: Template language for random string generation Ian Kelly <ian.g.kelly@gmail.com> - 2014-08-10 10:47 -0600
        Re: Template language for random string generation Paul Wolf <paulwolf333@gmail.com> - 2014-08-10 21:56 -0700
      Re: Template language for random string generation Devin Jeanpierre <jeanpierreda@gmail.com> - 2014-08-10 11:48 -0700
  Re: Template language for random string generation Ian Kelly <ian.g.kelly@gmail.com> - 2014-08-10 10:38 -0600

csiph-web