On Sun, 5 Jan 2014 00:11:18 -0800 Glyph <[email protected]> wrote: > On Jan 4, 2014, at 11:46 PM, Guido van Rossum <[email protected]> wrote: > > > This is similar to the URL-ish syntax I've seen in database drivers > > for specifying the database server. > > Yeah, it's the same principle. > > > I suppose we could support the > > Twisted syntax (if it's documented well enough) or make up our own, > > possibly borrowing from URLs (which are another variant of the same > > idea). > > Twisted's syntax is actually pretty bad; the mere fact of the syntax is a > great idea but I'd suggest only looking at the particulars of the syntax > itself to learn from its mistakes :-). > > The syntax is > 'endpoint-type:positional1:pos2:keyword1=kwval1:keyword2=kwval2'. The > problem with this is of course colons are pretty popular thing that you need > to be able to type in e.g. IPv6 address literals and win32 paths, so lots of > endpoint types require escaping; 'tcp6:\:\:1' is how you say 'localhost' for > example.
Why not actual URIs? Your latter example could then be spelled "tcp6:[::1]". Also, URIs allow both parameters and query arguments at the end, and escaping is handled by %-escaping. Regards Antoine.
