Python's generator expressions let you get the common 90% of what you would do with Linq. Generator expressions, however, quickly become awkward when nested and don't really support joining or grouping data. Python has a groupby method and similar helpers, but they simply aren't as natural as the SQL-style syntax. Also, Linq puts the object being queried first to make it toolable (IntelliSense can offer completion for members in where and select clauses, etc).
I don't know much Ruby, but I'd suspect that blocks can simulate Linq far better than Python can. However, the Lambda-inspired syntax is a bit cluttered when compared to the SQL-inspired syntax.
Linq is a feature about 3 things:
1) Correctness via static typing checks
2) Interoperability of various data backends (Microsoft provides backends for XML, SQL, and .NET objects)
3) Clean and beautiful code
Neither Python nor Ruby can provide #1 (at compile time, anyway). SqlAlchemy and other projects attempt #2, but I don't have enough experience with them to comment on their success. And while Python as a whole (and I presume Ruby) has lots of #3, complex data querying is not the most beautiful experience.
I don't know much Ruby, but I'd suspect that blocks can simulate Linq far better than Python can. However, the Lambda-inspired syntax is a bit cluttered when compared to the SQL-inspired syntax.
Linq is a feature about 3 things:
1) Correctness via static typing checks
2) Interoperability of various data backends (Microsoft provides backends for XML, SQL, and .NET objects)
3) Clean and beautiful code
Neither Python nor Ruby can provide #1 (at compile time, anyway). SqlAlchemy and other projects attempt #2, but I don't have enough experience with them to comment on their success. And while Python as a whole (and I presume Ruby) has lots of #3, complex data querying is not the most beautiful experience.