Re: Linq to Python

2008-10-27 Thread Duncan Booth
"Tim Rowe" <[EMAIL PROTECTED]> wrote: >> I haven't yet had occasion to use LINQ in anger yet, so I have no >> idea whether its an idea to love or to hate. I do think it is good >> that C# has effectively sprouted list comprehensions (not to mention >> anonymous types and type inferencing) and I ex

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 a

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 -- ht

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

Re: Linq to Python

2008-09-25 Thread Duncan Booth
sturlamolden <[EMAIL PROTECTED]> wrote: > 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

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

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 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

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 xmlGuys.Eleme

Re: Linq to Python

2008-09-25 Thread hrishy
) regards Hrishy --- On Wed, 24/9/08, Tim Golden <[EMAIL PROTECTED]> wrote: > From: Tim Golden <[EMAIL PROTECTED]> > Subject: Re: Linq to Python > To: > Cc: python-list@python.org > Date: Wednesday, 24 September, 2008, 8:20 PM > [EMAIL PROTECTED] wrote: > > s

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("stoog

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 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,

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 xmlGuys

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 c

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 wr

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 fi

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

Re: Linq to Python

2008-09-24 Thread Thomas G. Willis
On Sep 24, 4:59 pm, Duncan Booth <[EMAIL PROTECTED]> wrote: ... > I haven't yet had occasion to use LINQ in anger yet, so I have no idea > whether its an idea to love or to hate. I do think it is good that C# has > effectively sprouted list comprehensions (not to mention anonymous types > and type

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 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? >

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, an

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 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

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

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 pres

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 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 comprehension

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. > >

Re: Linq to Python

2008-09-24 Thread hrishy
wrote: > 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 gener

Re: Linq to Python

2008-09-24 Thread hrishy
upposed to make everything easy ? regards Hrishy --- On Tue, 23/9/08, sturlamolden <[EMAIL PROTECTED]> wrote: > From: sturlamolden <[EMAIL PROTECTED]> > Subject: Re: Linq to Python > To: python-list@python.org > Date: Tuesday, 23 September, 2008, 7:49 PM > On Sep

Re: Linq to Python

2008-09-24 Thread hrishy
On Tue, 23/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 suggesti

Re: Linq to Python

2008-09-23 Thread Terry Reedy
> Will LINQ be ported to Python ? I have three suggestions: 1. When starting a new thread, start a *new* thread. Don't tack a new, unrelated subject onto an existing thread. Your post will not be seen by people with readers that collapse thread and who do not happen to read the 'Python is s

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 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 o

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 so

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 impl

Re: Linq to Python

2008-09-23 Thread hrishy
]> > Subject: Re: 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-abstractio

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 -- http://mail.python.org/mailman/listinfo

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