Closed ghost closed 9 years ago
Sorry for the late response. I'm travelling much recently.
All of this are intended behaviors, despite it seems odd. OP is designed to be friendly to beginners and powerful for super-users. First group greatly appreciate that invalid queries return what they need, second group (like you) know that the query is invalid anyway. :)
Nevertheless, I need to think whether supporting edge cases vs overall language consistency is more important.
BTW. I'm focusing on JS version of ObjectPath. Python has it's limitations and developing ObjectPath became overly complicated. JS is more low level language and has native support for JSON so its simpler. Check it out if you like at https://github.com/adriank/ObjectPath.JS
Invalid queries return valid results on non-object elements of the tree (e.g. numbers, strings, sequence of strings)
Using the dataset from main page:
Same applies to sequences of strings:
in Python last line yields an empty generator.