babel icon indicating copy to clipboard operation
babel copied to clipboard

Fix #774: Allow object methods to be used as extraction-keywords

Open embray opened this issue 1 year ago • 2 comments

Proof of concept fix for #774. I did this quickly using peekable() from the more-itertools package, but if adding a new dependency just for this is (understandably) undesirable, it could be fixed just as easily with slight improvements to the generate tokens loop (in fact I had a version of that working earlier, but it gets a bit hairier with the nested case).

This would conflict with #1127, so if this is otherwise acceptable as a feature can rebase on top of that and without using more-itertools.

embray avatar Oct 03 '24 10:10 embray

Thank you! Yeah, this makes sense, but we definitely don't want an extra dependency :)

Maybe we can vendor (a subset of) peekable if that makes implementing this easier. Tests should also ensure multi-dotted names such as my.corporate.app.translations.execute() work :)

akx avatar Oct 19 '24 12:10 akx

Great, given the go-ahead I'll rework this. peekable() is nice but I don't think it's really needed either.

I like how your example pokes fun at the "Enterprise-y" nature of this ;). But I swear I had a really good use case for this and wanted to make it work.

embray avatar Oct 19 '24 13:10 embray