[Python-porting] Pattern help!?

Lennart Regebro regebro at gmail.com
Thu Nov 18 15:03:21 CET 2010


On Thu, Nov 18, 2010 at 15:00, Benjamin Peterson <benjamin at python.org> wrote:
> 2010/11/18 Lennart Regebro <regebro at gmail.com>:
>> I can't find a pattern that will match:
>>    foo
>> But not
>>    bar.foo
>>
>> Any hints?
>
> It's usually best to do something like "is_probably_builtin" in
> lib2to3/fixer_utils.py.

Ah, thanks! That's similar to what I did already, but I missed out on
this helper (as it's slightly weirdly named), and this one catches
several cases I didn't think of.

//Lennart


More information about the Python-porting mailing list