TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

A tool to search for Python code using jQuery-like selectors

7 pointsby caioariedeover 9 years ago

1 comment

canduover 9 years ago
Interesting idea, and a great exercise for learning more about parsing, CSS selectors, and command-line interfaces.<p>One point of (hopefully) constructive criticism: I&#x27;m not completely sold on the CSS selector syntax. Attribute selectors are semantically meaningful in the DOM, not as much so in Python.<p>Providing a more Pythonic query language might make it easier for users to guess the purpose of queries and to build complex queries of their own. For instance:<p><pre><code> class * extends IntegerField class FloatField class FloatField: def * class FloatField: def to* from collections import Counter </code></pre> or perhaps:<p><pre><code> class FloatField: def to*(foo) for * in *: if * is None </code></pre> (or perhaps even `for $1 in <i>: if $1 is None`. There are probably better ways than what I described to express the wildcard part, especially if you want to distinguish these from `</i>args`, `<i></i>kwargs`...)<p>Anyways, it&#x27;s always awesome to see people putting their work out there, and I hope you&#x27;ll continue to do so!
评论 #11061099 未加载