Keyboard Layout: Dvorak vs Colemak: is it Worthwhile to Improve the Dvorak Layout?

2011-06-11 Thread Xah Lee
(a lil weekend distraction from comp lang!) in recent years, there came this Colemak layout. The guy who created it, Colemak, has a site, and aggressively market his layout. It's in linuxes distro by default, and has become somewhat popular. I remember first discovering it perhaps in 2007. Me, be

Re: (*args **kwargs) how do I use' em?

2011-06-11 Thread FELD Boris
A good tutorial will surely help : http://www.saltycrane.com/blog/2008/01/how-to-use-args-and-kwargs-in-python/ The idea between *args and *kwargs is to create function (callables) which accepts an arbitrary number of anonymous and/or keyword arguments. It's useful when you want to create a fu

Re: (*args **kwargs) how do I use' em?

2011-06-11 Thread OliDa
On 11 juin, 07:01, TheSaint wrote: > Hello, > I'm seldomly writng python code, nothing but a beginner code. > > I wrote these lines >> > > = > _log_in= mhandler.ConnectHandler(lmbox, _logger, accs) > multhr= sttng['multithread'] > if mult

Square bracket and dot notations?

2011-06-11 Thread Asen Bozhilov
Hi all, I am beginner in Python. What is interesting for me is that Python interpreter treats in different way dot and square bracket notations. I am coming from JavaScript where both notations lead prototype chain lookup. In Python it seems square bracket and dot notations lead lookup in differen

Overcharged

2011-06-11 Thread Ethan
I mad a call last night and never even talked to anybody, I knew I was being charged to just look and I'm ok with that amount u was charged. There was another charge though of I think 26 dollers witch I was not told or warned about at all, I need to know who I can call and talk to about this S

Re: Square bracket and dot notations?

2011-06-11 Thread Andrew Berg
On 2011.06.11 04:41 AM, Asen Bozhilov wrote: > Hi all, > I am beginner in Python. What is interesting for me is that Python > interpreter treats in different way dot and square bracket notations. > I am coming from JavaScript where both notations lead prototype chain > lookup. > > In Python it seem

Re: Square bracket and dot notations?

2011-06-11 Thread Ben Finney
Asen Bozhilov writes: > I am beginner in Python. What is interesting for me is that Python > interpreter treats in different way dot and square bracket notations. > I am coming from JavaScript where both notations lead prototype chain > lookup. Run, don't walk, to the Python Tutorial. Work throu

Re: Overcharged

2011-06-11 Thread Paul Rubin
Ethan writes: > I mad a call last night and never even talked to anybody, > Sent from my Samsung Epic™ 4G Your Epic 4G must not have been programmed in Python. -- http://mail.python.org/mailman/listinfo/python-list

Re: Square bracket and dot notations?

2011-06-11 Thread Francesco Bochicchio
On 11 Giu, 11:41, Asen Bozhilov wrote: > Hi all, > I am beginner in Python. What is interesting for me is that Python > interpreter treats in different way dot and square bracket notations. > I am coming from JavaScript where both notations lead prototype chain > lookup. > > In Python it seems squ

Re: (*args **kwargs) how do I use' em?

2011-06-11 Thread TheSaint
OliDa wrote: > maybe some clarification about kwargs... > > http://stackoverflow.com/questions/1098549/proper-way-to-use-kwargs-in- python Great point. Now it's clearer :) I think I'll share the dictionary which contains the configuration loaded form a file. -- goto /dev/null -- http://mail.

Re: Recursion error in metaclass

2011-06-11 Thread Steven D'Aprano
On Sat, 11 Jun 2011 01:33:25 -0400, Terry Reedy wrote: > On 6/10/2011 11:34 PM, Steven D'Aprano wrote: >> I have a metaclass in Python 3.1: >> >> class MC1(type): >> @staticmethod >> def get_mro(bases): >> print('get_mro called') >> return type('K', bases, {}).__mro__[1

Re: uhmm... your chance to spit on me

2011-06-11 Thread rusi
On Jun 11, 5:36 am, Jim Burton wrote: > Xah Lee writes: > > Dear lisp comrades, it's Friday! > > The answers to your question give poor coverage of the possible > responses to your writing. I myself enjoy reading what you write, most > of the time, but become bored +1 on the 'poor coverage'

Python Card alternatives?

2011-06-11 Thread rzed
Desktop apps don't seem to be the wave of the future, but they still serve a useful purpose today. They can be ideal for a quick database table management screen, or a data entry front end for a program with a bunch of parameters. It's not easy enough to build a quick utility with a GUI front e

Re: Square bracket and dot notations?

2011-06-11 Thread Asen Bozhilov
Francesco Bochicchio wrote: > User classes - that is the ones you define with the class statement - > can implement support for the squared bracket and > dot notations: > -  the expression myinstance[index] is sort of translated into  of > myinstance.__getitem__(index) > -   the expression myinsta

Re: parallel computations: subprocess.Popen(...).communicate()[0] does not work with multiprocessing.Pool

2011-06-11 Thread Miki Tebeka
Greetings, >cmd1 = "/usr/local/bin/matlab ... myMatlab.1.m" >subprocess.Popen([cmd1], shell=True, > stdout=subprocess.PIPE).communicate()[0] Try a list of arguments as the command to run. subprocess.Popen(["/usr/local/bin/matlab", ... "myMatlab.l.m"] ...) If you can switch to 2.7, you'

Re: Python Card alternatives?

2011-06-11 Thread Luis M . González
As you said, desktop apps are losing appeal. I suggest looking for a web based solution. Perhaps python + silverlight? (I haven't tried it though). Unfortunately, the client-side (browser) is the domain of javascript. What I'm doing is polishing my html/css skills coupled with jquery. I have lost

Re: Python Card alternatives?

2011-06-11 Thread python
Luis, Not the OP, but thank you for passing on the CoffeeScript recommendation - looks very interesting!! http://jashkenas.github.com/coffee-script/ Regards, Malcolm -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Card alternatives?

2011-06-11 Thread Tim Johnson
* rzed [110611 05:14]: > Desktop apps don't seem to be the wave of the future, but they still > serve a useful purpose today. They can be ideal for a quick database > table management screen, or a data entry front end for a program with > a bunch of parameters. It's not easy enough to build a q

How to avoid "()" when writing a decorator accepting optional arguments?

2011-06-11 Thread Giampaolo Rodolà
I've written this decorator to deprecate a function and (optionally) provide a callable as replacement def deprecated(repfun=None): """A decorator which can be used to mark functions as deprecated. Optional repfun is a callable that will be called with the same args as

Re: Recursion error in metaclass

2011-06-11 Thread Terry Reedy
On 6/11/2011 7:38 AM, Steven D'Aprano wrote: On Sat, 11 Jun 2011 01:33:25 -0400, Terry Reedy wrote: On 6/10/2011 11:34 PM, Steven D'Aprano wrote: I have a metaclass in Python 3.1: class MC1(type): @staticmethod def get_mro(bases): print('get_mro called') return

Re: Square bracket and dot notations?

2011-06-11 Thread Terry Reedy
On 6/11/2011 10:40 AM, Asen Bozhilov wrote: It is exactly what I wanted to know. Thank you. I have not examined classes in Python yet, but when I do it I will understand some new things. One of the most interesting is, can an object inherit items trough the parent class? By items I mean items wh

Re: How to avoid "()" when writing a decorator accepting optional arguments?

2011-06-11 Thread Ian Kelly
On Sat, Jun 11, 2011 at 1:27 PM, Giampaolo Rodolà wrote: >    @deprecated() >    def foo(): >        return 0 This is equivalent to: foo = deprecated()(foo) >    @deprecated(some_function) >    def foo(): >        return 0 foo = deprecated(some_function)(foo) >    @deprecated >    def foo():

Re: How to avoid "()" when writing a decorator accepting optional arguments?

2011-06-11 Thread Terry Reedy
On 6/11/2011 3:27 PM, Giampaolo Rodolà wrote: I've written this decorator to deprecate a function and (optionally) provide a callable as replacement def deprecated(repfun=None): """A decorator which can be used to mark functions as deprecated. Optional repfun is a callabl

Emacs Python indention

2011-06-11 Thread Bastian Ballmann
Hi Emacs / Python coders, moving a region of python code for more than one indention in Emacs is quite annoying, cause the python-shift-left and -right functions always loose the mark and one has to reactivate it with \C-x \C-x or guess how many indentions one want to make and do a \C-u \C-c > T

Re: Square bracket and dot notations?

2011-06-11 Thread Asen Bozhilov
Terry Reedy wrote: > Right. d.items is a dict method. d['items'] is whatever you assign. > Named tuples in the collections modules, which allow access to fields > through .name as well as [index], have the name class problem. All the > methods are therefore given leading underscore names to avoid

Re: Recursion error in metaclass

2011-06-11 Thread Daniel Urban
On Sat, Jun 11, 2011 at 21:39, Terry Reedy wrote: > What may not be obvious from the docs is that the metaclass calculation > described in the doc section on class statements is carried out within > type.__new__ (or after a possible patch, called from within that), so that > type calls are really

__dict__ is neato torpedo!

2011-06-11 Thread Andrew Berg
I'm pretty happy that I can copy variables and their value from one object's namespace to another object's namespace with the same variable names automatically: class simpleObject(): pass a = simpleObject() b = simpleObject() a.val1 = 1 a.val2 = 2 b.__dict__.update(a.__dict__) a.val1 = 'a'

Re: __dict__ is neato torpedo!

2011-06-11 Thread Terry Reedy
On 6/11/2011 9:32 PM, Andrew Berg wrote: I'm pretty happy that I can copy variables and their value from one You are copying names and their associations, but not the objects or thier values. object's namespace to another object's namespace with the same variable names automatically: class

Re: __dict__ is neato torpedo!

2011-06-11 Thread Steven D'Aprano
On Sat, 11 Jun 2011 20:32:37 -0500, Andrew Berg wrote: > I'm pretty happy that I can copy variables and their value from one > object's namespace to another object's namespace with the same variable > names automatically: > > class simpleObject(): > pass > > a = simpleObject() > b = simpleOb

Re: __dict__ is neato torpedo!

2011-06-11 Thread Andrew Berg
On 2011.06.11 09:12 PM, Terry Reedy wrote: > On 6/11/2011 9:32 PM, Andrew Berg wrote: > > I'm pretty happy that I can copy variables and their value from one > > You are copying names and their associations, but not the objects or > thier values. Associations? The update() method copies the values

Re: __dict__ is neato torpedo!

2011-06-11 Thread Andrew Berg
On 2011.06.11 09:13 PM, Steven D'Aprano wrote: > So never update from a random object you don't know well. Of course. In the project I'm working on, this will be used in the __init__() method of a class that accepts a pair of dictionaries or possibly **kwargs (for flexibility and to avoid the very

Re: __dict__ is neato torpedo!

2011-06-11 Thread Ian Kelly
On Sat, Jun 11, 2011 at 8:21 PM, Andrew Berg wrote: > On 2011.06.11 09:12 PM, Terry Reedy wrote: >> On 6/11/2011 9:32 PM, Andrew Berg wrote: >> > I'm pretty happy that I can copy variables and their value from one >> >> You are copying names and their associations, but not the objects or >> thier

Re: __dict__ is neato torpedo!

2011-06-11 Thread Andrew Berg
On 2011.06.11 10:08 PM, Ian Kelly wrote: > For immutable objects such as > ints, this doesn't matter. For mutable objects such as lists, it can: Well, that's confusing. How would I make actual copies? -- http://mail.python.org/mailman/listinfo/python-list

Re: __dict__ is neato torpedo!

2011-06-11 Thread Ben Finney
Andrew Berg writes: > On 2011.06.11 10:08 PM, Ian Kelly wrote: > > For immutable objects such as ints, this doesn't matter. For mutable > > objects such as lists, it can: > Well, that's confusing. It's exactly the same as with an ordinary assignment (‘a = b’) in Python. You will likely want to w

which threading libraries to use?

2011-06-11 Thread Dennis
Hi, Are there any reasons besides personal preference to use one particular threading library over the other? Eventlet, Twisted, and Python's native Threading class, or are there even others? Are there any licensing or redistribution restrictions that I should be worried about? Which ones do yo

Re: __dict__ is neato torpedo!

2011-06-11 Thread Andrew Berg
On 2011.06.11 10:40 PM, Ben Finney wrote: > It's exactly the same as with an ordinary assignment (‘a = b’) in > Python. Fair enough. > > How would I make actual copies? > At what level? Level? I just want to be able to create an object b with values from dictionary a, and not have changes to a refl

Re: which threading libraries to use?

2011-06-11 Thread Chris Angelico
On Sun, Jun 12, 2011 at 2:10 PM, Dennis wrote: > Hi, > > Are there any reasons besides personal preference to use one > particular threading library over the other?  Eventlet, Twisted, and > Python's native Threading class, or are there even others?  Are there > any licensing or redistribution res

Re: __dict__ is neato torpedo!

2011-06-11 Thread Ian Kelly
On Sat, Jun 11, 2011 at 10:32 PM, Andrew Berg wrote: > On 2011.06.11 10:40 PM, Ben Finney wrote: >> It's exactly the same as with an ordinary assignment (‘a = b’) in >> Python. > Fair enough. >> > How would I make actual copies? >> At what level? > Level? I just want to be able to create an object