Re: multiple inheritance from list and other class

2012-01-07 Thread Steven D'Aprano
On Sat, 07 Jan 2012 17:16:22 -0800, lars van gemerden wrote: > Hello, > > I have an error message i do not understand: > > My code is in essence: The code you give works fine. It does not show the error you say it does. Please test your code before posting and ensure it actually fails the way

Re: multiple inheritance from list and other class

2012-01-07 Thread Steven D'Aprano
On Sat, 07 Jan 2012 22:08:22 -0800, 8 Dihedral wrote: [...] > The class is defined in a silly way. > In python declaring a class with only trivial properties added is not > very python at all. The example given looks like a Mixin class, which is perfectly acceptable in Python. -- Steven

Re: multiple inheritance from list and other class

2012-01-07 Thread 88888 Dihedral
A list is a container. Chris Angelico於 2012年1月8日星期日UTC+8上午9時27分06秒寫道: > On Sun, Jan 8, 2012 at 12:16 PM, lars van gemerden > wrote: > > Hello, > > > > I have an error message i do not understand: > > > > My code is in essence: > > > > b = B([1,2,3,4]) > > > > error: > >    b = B([0,1,2,3,4]) >

Re: MOST COMMON QUESTIONS ASKED BY NON-MUSLIMS ?????????

2012-01-07 Thread Lie Ryan
On 01/04/2012 05:24 AM, gene heskett wrote: On Tuesday, January 03, 2012 01:13:08 PM John Ladasky did opine: On Jan 3, 7:40 am, BV wrote: MOST COMMON QUESTIONS ASKED BY NON-MUSLIMS Q0. Why do thousand-line religious posts appear in comp.lang.python? Already discussed, at considerable leng

Re: Nested Function Question

2012-01-07 Thread 88888 Dihedral
GZ於 2012年1月7日星期六UTC+8上午5時46分16秒寫道: > Hi, > > I am reading the documentation of functools.partial (http:// > docs.python.org/library/functools.html#functools.partial) and found > the following 'reference implementation' of functools.partial. > > def partial(func, *args, **keywords): > def newf

Re: MOST COMMON QUESTIONS ASKED BY NON-MUSLIMS ?????????

2012-01-07 Thread David Monaghan
On Tue, 3 Jan 2012 09:57:50 -0800 (PST), John Ladasky wrote: >On Jan 3, 7:40 am, BV wrote: >> MOST COMMON QUESTIONS ASKED BY NON-MUSLIMS > >Q0. Why do thousand-line religious posts appear in comp.lang.python? You know, I would never have seen this post if you hadn't "authenticated" it by starti

Re: multiple inheritance from list and other class

2012-01-07 Thread Chris Angelico
On Sun, Jan 8, 2012 at 12:16 PM, lars van gemerden wrote: > Hello, > > I have an error message i do not understand: > > My code is in essence: > > b = B([1,2,3,4]) > > error: >    b = B([0,1,2,3,4]) > TypeError: B() takes exactly 2 arguments (1 given) Your code doesn't quite match your error mess

multiple inheritance from list and other class

2012-01-07 Thread lars van gemerden
Hello, I have an error message i do not understand: My code is in essence: class A(object): #no __new__ or __init__ def meth1(self, args): #some code def meth2(self, args): #some code class B(list, A) pass b = B([1,2,3,4]) error: Traceback (most recent call last):

Re: Getting involved

2012-01-07 Thread Eric Snow
On Sat, Jan 7, 2012 at 1:39 PM, Antoine Pitrou wrote: > > Hello, > > Sophie Sperner gmail.com> writes: >> >> Let me ask here please. I'm a first-year PhD student in Ireland. My >> background is in mathematics, though I'm going to stream my career >> into programming with Python, Java and C++ lang

Re: Installing a script and use it via python -m

2012-01-07 Thread Cameron Simpson
On 07Jan2012 10:32, Oktaka Com wrote: | Is there a way to do below: | | 1) install via setup.py some script: xxx.py | 2) python -m xxx.py | | In fact, this question opens to: Is there a platform independent way | to copy xxx.py to somewhere that the system will search for? Depends what's in you

Re: Getting involved

2012-01-07 Thread Antoine Pitrou
Hello, Sophie Sperner gmail.com> writes: > > Let me ask here please. I'm a first-year PhD student in Ireland. My > background is in mathematics, though I'm going to stream my career > into programming with Python, Java and C++ languages. I have some good > experience with C++ what allowed me to

Installing a script and use it via python -m

2012-01-07 Thread Oktaka Com
Hi all, Is there a way to do below: 1) install via setup.py some script: xxx.py 2) python -m xxx.py In fact, this question opens to: Is there a platform independent way to copy xxx.py to somewhere that the system will search for? Thanks, -- http://mail.python.org/mailman/listinfo/python-list

Re: Calling a variable inside a function of another class

2012-01-07 Thread Yigit Turgut
On Jan 7, 6:01 pm, Steven D'Aprano wrote: > On Sat, 07 Jan 2012 07:00:57 -0800, Yigit Turgut wrote: > > I am trying to call a variable located in a function of a class from > > main but couldn't succeed.Any ideas? > > You cannot access local variables from outside their function. That's why > they

Re: Calling a variable inside a function of another class

2012-01-07 Thread Steven D'Aprano
On Sat, 07 Jan 2012 07:00:57 -0800, Yigit Turgut wrote: > I am trying to call a variable located in a function of a class from > main but couldn't succeed.Any ideas? You cannot access local variables from outside their function. That's why they are called *local* variables. You probably want to

Re: python philosophical question - strong vs duck typing

2012-01-07 Thread 88888 Dihedral
Terry Reedy於 2012年1月5日星期四UTC+8上午4時22分03秒寫道: > On 1/4/2012 1:37 AM, Terry Reedy wrote: > > On 1/3/2012 8:04 PM, Devin Jeanpierre wrote: > > >> [ An example of a simple dependently typed program: > >> http://codepad.org/eLr7lLJd ] > > > > Just got it after a minute delay. > > A followup now that I

Re: Nested Function Question

2012-01-07 Thread David Robinow
On Fri, Jan 6, 2012 at 5:04 PM, Ian Kelly wrote: > On Fri, Jan 6, 2012 at 2:46 PM, GZ wrote: >> Hi, >> >> I am reading the documentation of functools.partial (http:// >> docs.python.org/library/functools.html#functools.partial) and found >> the following 'reference implementation' of functools.pa

Calling a variable inside a function of another class

2012-01-07 Thread Yigit Turgut
class test(test1): def __init__(self, device): . . . def _something(self, x=1) self.dt = data if __name__ == "__main__": test.something.dt ??? I am trying to call a variable located in a function of a class from main but couldn't succeed.Any ideas? -- http:/

Re: Getting involved - Jython ElementTree performance

2012-01-07 Thread Stefan Behnel
Sophie Sperner, 07.01.2012 13:01: > On Jan 7, 11:53 am, Stefan Behnel wrote: >> A big issue that I have with Jython is that its ElementTree XML parser >> support is so increadibly slow. It could seriously benefit from a better >> integration between the Java XML support it uses and the Python Eleme

Re: your feedback to my first project please

2012-01-07 Thread Peter Otten
patr...@bierans.de wrote: > I know the TestCases are ugly, I still have no feeling for it. I forgot to mention: instead of testing each and every thing in one big method put each test into a short dedicated TestCase.test_... method. That reduces the risk of undetected side effects and often all

Re: your feedback to my first project please

2012-01-07 Thread D'Arcy Cain
On 12-01-07 07:10 AM, patr...@bierans.de wrote: It's my first script in python and I'd like to know if my way of coding so far is right and if YOU have some little tips for me or if you can point my nose on some things I've missed so far. Looks pretty good overall. I have a little armchair qua

Re: your feedback to my first project please

2012-01-07 Thread Peter Otten
patr...@bierans.de wrote: >It's my first script in python and I'd like to know if my way >of coding A warm welcome and a grumpy "please post in plain-text" ;) >I am settled - so you can go full on. ;) You seem to be sure you won't regret that ;) >- What about my coding style i

Re: Getting involved

2012-01-07 Thread Sophie Sperner
On Jan 7, 11:53 am, Stefan Behnel wrote: > Andrew Berg, 07.01.2012 12:16: > > > On 1/7/2012 4:59 AM, Sophie Sperner wrote: > >> Could you please list me 2 or 3 projects in Python and/or Java which > >> are currently active (vivid) and useful? > > > If you really want to mix Python and Java, you co

Re: Getting involved

2012-01-07 Thread Stefan Behnel
Andrew Berg, 07.01.2012 12:16: > On 1/7/2012 4:59 AM, Sophie Sperner wrote: >> Could you please list me 2 or 3 projects in Python and/or Java which >> are currently active (vivid) and useful? > > If you really want to mix Python and Java, you could help the Jython > project [...] A big issue that

Re: Getting involved

2012-01-07 Thread Sophie Sperner
Jython, don't want to migrate something. Then Django is very boring project. -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting involved

2012-01-07 Thread Sophie Sperner
On Jan 7, 11:13 am, Chris Angelico wrote: > On Sat, Jan 7, 2012 at 9:59 PM, Sophie Sperner > wrote: > > Could you please list me 2 or 3 projects in Python and/or Java which > > are currently active (vivid) and useful? > > Easiest way to find a project to join would be to go to SourceForge, > Goo

Re: Getting involved

2012-01-07 Thread Andrew Berg
On 1/7/2012 4:59 AM, Sophie Sperner wrote: > Could you please list me 2 or 3 projects in Python and/or Java which > are currently active (vivid) and useful? If you really want to mix Python and Java, you could help the Jython project update to 3.x. One thing the Python community as a whole could re

Re: Getting involved

2012-01-07 Thread Chris Angelico
On Sat, Jan 7, 2012 at 9:59 PM, Sophie Sperner wrote: > Could you please list me 2 or 3 projects in Python and/or Java which > are currently active (vivid) and useful? Easiest way to find a project to join would be to go to SourceForge, Google Code, GitHub, BitBucket, or any other large hosting f

Getting involved

2012-01-07 Thread Sophie Sperner
Dear community, Let me ask here please. I'm a first-year PhD student in Ireland. My background is in mathematics, though I'm going to stream my career into programming with Python, Java and C++ languages. I have some good experience with C++ what allowed me to have a presentation in Europe quite r

Re: how to get id(function) for each function in stack?

2012-01-07 Thread Robert Kern
On 1/7/12 12:17 AM, Lie Ryan wrote: On 01/07/2012 06:50 AM, Ian Kelly wrote: On Fri, Jan 6, 2012 at 12:29 PM, dmitrey wrote: Python build-in function sum() has no attribute func_code, what should I do in the case? Built-in functions and C extension functions have no code objects, and for that

[no subject]

2012-01-07 Thread abdullah zuberi
hello ? -- http://mail.python.org/mailman/listinfo/python-list