[Python-Dev] Misc re.match() complaint

MRAB python at mrabarnett.plus.com
Wed Jul 17 15:56:44 CEST 2013


On 17/07/2013 05:15, Stephen J. Turnbull wrote:
> Terry Reedy writes:
>   > On 7/15/2013 10:20 PM, Guido van Rossum wrote:
>   >
>   > >> Or is this something deeper, that a group *is* a new object in
>   > >> principle?
>   > >
>   > > No, I just think of it as returning "a string"
>   >
>   > That is exactly what the doc says it does. See my other post.
>
> The problem is that IIUC '"a string"' is intentionally *not* referring
> to the usual "str or bytes objects" (at least that's one of the
> standard uses for scare quotes, to indicate an unusual usage).  Either
> the docstring is using "string" in a similarly ambiguous way, or else
> it's incorrect under the interpretation that buffer objects are *not*
> "strings", so they should be inadmissible as targets.  Something
> should be fixed, and I suppose it should be the return type of group().
>
> BTW, I suggest that Terry's usage of "string" (to mean "str or bytes"
> in 3.x, "unicode or str" in 2.x) be adopted, and Guido's "stringish"
> be given expanded meaning, including buffer objects.  Then we can say
> informally that in searching and matching a target is a stringish, the
> pattern is a stringish (?) or compiled re, but the group method
> returns a string.
>
Instead of "stringish", how about "stringoid"? To me, "stringish" is an
adjective, but "stringoid" can be a noun or an adjective.

According to http://dictionary.reference.com:

"""
-oid

—suffix forming adjectives, —suffix forming nouns
	indicating likeness, resemblance, or similarity: anthropoid
"""



More information about the Python-Dev mailing list