While you can certainly argue for (or against) any of the different globbing behaviors - ranging from "the shell"'s (interpret wildcards literally, if no match in the file system) to Python's (always test for existence) - ultimately, it's a matter of preference.
Personally, I find Perl's mixed behavior rather "do-what-I-mean". I.e., when I specify a ? or * wildcard, I'm typically interested in what matching files there are in the file system, while if I use a "limited set" wildcard like {a,b,c}, I can compactly compute permutations with it, e.g.
$ perl -le 'print for glob "{foo,bar}{baz,quux}"' foobaz fooquux barbaz barquux
which Python doesn't do because of its consistent behavior. IOW, consistent isn't always the most practically useful... :)
And, as for the shell, I always found its behavior to treat a "*" literally (in case nothing matches) a little counter-intuitive... (if I really mean a literal "*", I can always escape it in Perl).
Anyhow, YMMV.
In reply to Re: a glob w/ no wildcards returns itself
by Eliya
in thread a glob w/ no wildcards returns itself
by jeberle
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |