Re: Linq to Python

2008-10-27 Thread Tim Rowe
2008/9/24 Duncan Booth [EMAIL PROTECTED]: Python still wins hands down on this example both in verbosity and readability: But AFAICS, the Python version you give creates a temporary. One of the advantages cited for LINQs functional programming paradigm is that it specifies what is wanted at a

Re: Linq to Python

2008-10-27 Thread Duncan Booth
of lambda expressions has a neat trick that is central to LINQ. A lambda expression compiles either to executable code, or to an expression tree. If you are filtering some C# sequence object then (as with Python lambdas) the LINQ code simply calls the compiled lambda expression like any other

Re: Linq to Python

2008-09-25 Thread Duncan Booth
sturlamolden [EMAIL PROTECTED] wrote: On Sep 24, 10:59 pm, Duncan Booth [EMAIL PROTECTED] wrote: Simple LINQ expressions like the one you gave map easily to Python list comprehensions. What Microsoft have done though is provide a consistent implementation which allows you to write complex

Re: Linq to Python

2008-09-25 Thread sturlamolden
On 25 Sep, 10:08, Duncan Booth [EMAIL PROTECTED] wrote: A lot of what LINQ does is already easy to do in Python, and most of the rest can probably be added fairly easily, but it does provide a consistent framework which may make it easier to do complex LINQ statements than complex list

Re: Linq to Python

2008-09-25 Thread hrishy
Hi If i rephrase my question how will i do this in Python http://informationr.net/ir/13-2/TB0806.html Watch this query on the page Where he joins all different kind of things with ease and elegance(as per my opinion) [code] var stoogeGuys = Beginning with the XML source from

Re: Linq to Python

2008-09-25 Thread hrishy
Hi Grant haha :-) i discounted that perspective :-) regards Hrishy --- On Thu, 25/9/08, Grant Edwards [EMAIL PROTECTED] wrote: From: Grant Edwards [EMAIL PROTECTED] Subject: Re: Linq to Python To: python-list@python.org Date: Thursday, 25 September, 2008, 2:22 AM On 2008-09-24, Bruno

Re: Linq to Python

2008-09-25 Thread hrishy
Hi Roger I am impressed (i always suspected Python programmers are smart no doubt about it). But what about the case where they join different sources like the one here http://informationr.net/ir/13-2/TB0806.html Thanks for teaching me :-) i am thankful for that regards Hrishy names =

Re: Linq to Python

2008-09-25 Thread sturlamolden
On 25 Sep, 12:06, hrishy [EMAIL PROTECTED] wrote: var stoogeGuys =      Beginning with the XML source      from xmlGuys in xmlSource.Descendants(Stooge)      Join to the array on the common element stoogeName      join arrayGuys in familyFacts            on xmlGuys.Element(stoogeName).Value

Re: Linq to Python

2008-09-25 Thread hrishy
Hi Tim I am not a LINQ expert just a LINQ user and (was a little envious why the langauge i fantasize doesnt have it (pardon my ignorance of python)) LINQ as far as i know allows you to query all sources using a consistent interface . You can query a message queue ,xml document ,array object

Re: Linq to Python

2008-09-25 Thread sturlamolden
On 25 Sep, 12:06, hrishy [EMAIL PROTECTED] wrote: [code] var stoogeGuys =      Beginning with the XML source      from xmlGuys in xmlSource.Descendants(Stooge)      Join to the array on the common element stoogeName      join arrayGuys in familyFacts            on

Re: Linq to Python

2008-09-25 Thread hrishy
Hi Pardon my ignorance again but id ont see any join in python or did i miss something ? regards Hrishy --- On Thu, 25/9/08, sturlamolden [EMAIL PROTECTED] wrote: From: sturlamolden [EMAIL PROTECTED] Subject: Re: Linq to Python To: python-list@python.org Date: Thursday, 25 September

Re: Linq to Python

2008-09-25 Thread sturlamolden
On 25 Sep, 13:08, hrishy [EMAIL PROTECTED] wrote: Pardon my ignorance again but id ont see any join in python or did i miss something ? It's more Pythonic to use the syntax of dictionary lookups. -- http://mail.python.org/mailman/listinfo/python-list

Re: Linq to Python

2008-09-25 Thread hrishy
Hi Thank you very much I appreciate taking the pain to explain this to me. regards Hrishy --- On Thu, 25/9/08, sturlamolden [EMAIL PROTECTED] wrote: From: sturlamolden [EMAIL PROTECTED] Subject: Re: Linq to Python To: python-list@python.org Date: Thursday, 25 September, 2008, 12:16 PM

Re: Linq to Python

2008-09-25 Thread Duncan Booth
99 or your 1 million rows. The apis defined by LINQ allow that sort of optimisation to happen transparently, the simple list would just test each element but the database would run an appropriate query. So what the 'can we have LINQ in Python' people are asking is to be able to write things

Re: Linq to Python

2008-09-25 Thread sturlamolden
On 25 Sep, 14:22, Duncan Booth [EMAIL PROTECTED] wrote: No Python's syntax is fine. The api's aren't as consistent though: Microsoft added a common set of extension methods which work on databases, xml, builtin sequences and can be easily extended to include other custom sequences. That is

Re: Linq to Python

2008-09-25 Thread bearophileHUGS
Duncan Booth: Microsoft added a common set of extension methods which work on databases, xml, builtin sequences and can be easily extended to include other custom sequences. When the processing is done in memory, LINQ may also work well with multi-core CPUs, see PLINQ. Bye, bearophile --

Re: Linq to Python

2008-09-24 Thread hrishy
/9/08, Terry Reedy [EMAIL PROTECTED] wrote: From: Terry Reedy [EMAIL PROTECTED] Subject: Re: Linq to Python To: python-list@python.org Date: Tuesday, 23 September, 2008, 7:51 PM Will LINQ be ported to Python ? I have three suggestions: 1. When starting a new thread, start a *new* thread

Re: Linq to Python

2008-09-24 Thread hrishy
Hi Well wouldn't it be a lot easier to query and join a xml source with a relational source with LINQ capabilites in Python. Hmm what am i missing here is there a site that takes all LINQ examples and does them using list comprehensions and makes them sound easy ? wasn't python supposed

Re: Linq to Python

2008-09-24 Thread hrishy
: From: Thomas G. Willis [EMAIL PROTECTED] Subject: Re: Linq to Python To: python-list@python.org Date: Tuesday, 23 September, 2008, 7:45 PM But surely the idea behind it will eventually spread.  It's really just comprehensions generalized over XML and relational datasets, a noble goal

Re: Linq to Python

2008-09-24 Thread Thomas G. Willis
On Wed, Sep 24, 2008 at 11:25 AM, hrishy [EMAIL PROTECTED] wrote: Hi Tom This is what i like and feel of the Python programmers smarter then every other langauge i know of. But i am not comfortable with your second statement XML i never need it one day everybody would need it. regards

Re: Linq to Python

2008-09-24 Thread sturlamolden
On Sep 24, 5:22 pm, hrishy [EMAIL PROTECTED] wrote: Well wouldn't it be a lot easier to query and join a xml source with a relational source with LINQ capabilites in Python. Hmm what am i missing here is there a site that takes all LINQ examples and does them using list comprehensions

Re: Linq to Python

2008-09-24 Thread bearophileHUGS
sturlamolden: No, because Python already has list comprehensions and we don't need the XML buzzword. LINQ is more than buzzwords. Python misses several of those features. So maybe for once the Python crowd may recognize such C# feature as much better than things present in Python. Said that, I

Re: Linq to Python

2008-09-24 Thread Tim Golden
[EMAIL PROTECTED] wrote: sturlamolden: No, because Python already has list comprehensions and we don't need the XML buzzword. LINQ is more than buzzwords. Python misses several of those features. So maybe for once the Python crowd may recognize such C# feature as much better than things

Re: Linq to Python

2008-09-24 Thread Chris Mellon
On Wed, Sep 24, 2008 at 2:11 PM, [EMAIL PROTECTED] wrote: sturlamolden: No, because Python already has list comprehensions and we don't need the XML buzzword. LINQ is more than buzzwords. Python misses several of those features. So maybe for once the Python crowd may recognize such C#

Re: Linq to Python

2008-09-24 Thread r0g
[EMAIL PROTECTED] wrote: sturlamolden: No, because Python already has list comprehensions and we don't need the XML buzzword. LINQ is more than buzzwords. Python misses several of those features. So maybe for once the Python crowd may recognize such C# feature as much better than things

Re: Linq to Python

2008-09-24 Thread Bruno Desthuilliers
hrishy a écrit : (snip) I apologise (I thought Python programmers were smart and they did know what LINQ was) Is there really any relation between being smart and knowing anything about the latest MS fad ? -- http://mail.python.org/mailman/listinfo/python-list

Re: Linq to Python

2008-09-24 Thread sturlamolden
On Sep 24, 9:11 pm, [EMAIL PROTECTED] wrote: In the meantime where I live lot of people will keep using C# instead of Python and CLisp, natural selection at work indeed. Please explain to me what Linq can do that Python does not. Put you emphasis on why this can't be done with a library, and

Re: Linq to Python

2008-09-24 Thread Duncan Booth
r0g [EMAIL PROTECTED] wrote: OK so maybe I'm being naive here but it looks to me like this new paradigm's big idea is to use a python + SQL type syntax to access data in random objects. Big whoop. It's not that difficult to write a generators that wraps XML files and databases is it? What

Re: Linq to Python

2008-09-24 Thread sturlamolden
On Sep 24, 10:59 pm, Duncan Booth [EMAIL PROTECTED] wrote: Simple LINQ expressions like the one you gave map easily to Python list comprehensions. What Microsoft have done though is provide a consistent implementation which allows you to write complex SQL like expressions which will work

Re: Linq to Python

2008-09-24 Thread Thomas G. Willis
delegates less cumbersome). To someone other than a C# person, these features are not new or revolutionary, it's just C# catching up. Kudos to them for getting there before java. After some more thought on what might conceivably be missing from python that LINQ has, that someone might want

Re: Linq to Python

2008-09-24 Thread Grant Edwards
On 2008-09-24, Bruno Desthuilliers [EMAIL PROTECTED] wrote: hrishy a écrit : (snip) I apologise (I thought Python programmers were smart and they did know what LINQ was) Is there really any relation between being smart and knowing anything about the latest MS fad ? God, I hope not -- or

Re: Linq to Python

2008-09-24 Thread r0g
Duncan Booth wrote: r0g [EMAIL PROTECTED] wrote: OK so maybe I'm being naive here but it looks to me like this new paradigm's big idea is to use a python + SQL type syntax to access data in random objects. Big whoop. It's not that difficult to write a generators that wraps XML files and

Linq to Python

2008-09-23 Thread hrishy
Hi Will LINQ be ported to Python ? regards Hrishy -- http://mail.python.org/mailman/listinfo/python-list

Re: Linq to Python

2008-09-23 Thread Diez B. Roggisch
hrishy wrote: Hi Will LINQ be ported to Python ? Take a look at SQLAlchemy or SQLObject for python-based ORM/SQL-abstractions. Apart from that, python is already heavily based on concepts like iterators, filtering. Take a look at itertools. Diez --

Re: Linq to Python

2008-09-23 Thread hrishy
: Linq to Python To: python-list@python.org Date: Tuesday, 23 September, 2008, 4:06 PM hrishy wrote: Hi Will LINQ be ported to Python ? Take a look at SQLAlchemy or SQLObject for python-based ORM/SQL-abstractions. Apart from that, python is already heavily based on concepts like

Re: Linq to Python

2008-09-23 Thread Jason Scheirer
On Sep 23, 7:48 am, hrishy [EMAIL PROTECTED] wrote: Hi Will LINQ be ported to Python ? regards Hrishy I think this question is more appropriate to ask on an IronPython development list -- LINQ is pretty solidly intertwined with .Net, and so you'll likely want to look at the .Net

Re: Linq to Python

2008-09-23 Thread namekuseijin
On Sep 23, 2:07 pm, Jason Scheirer [EMAIL PROTECTED] wrote: On Sep 23, 7:48 am, hrishy [EMAIL PROTECTED] wrote: Hi Will LINQ be ported to Python ? regards Hrishy I think this question is more appropriate to ask on an IronPython development list -- LINQ is pretty solidly intertwined

Re: Linq to Python

2008-09-23 Thread Thomas G. Willis
But surely the idea behind it will eventually spread.  It's really just comprehensions generalized over XML and relational datasets, a noble goal.  Besides, it's main purpose for .NET was to bring functional programming to it.  Python already has that, somewhat... it's really any object out

Re: Linq to Python

2008-09-23 Thread sturlamolden
On Sep 23, 4:48 pm, hrishy [EMAIL PROTECTED] wrote: Will LINQ be ported to Python ? No, because Python already has list comprehensions and we don't need the XML buzzword. -- http://mail.python.org/mailman/listinfo/python-list

Re: Linq to Python

2008-09-23 Thread Terry Reedy
for an answer. If you mean the .NET component, googling 'Python LINQ' should partly answer your question. tjr -- http://mail.python.org/mailman/listinfo/python-list