Re: Psyco alternative

2008-03-29 Thread Luis M . González
On 27 mar, 13:14, king kikapu <[EMAIL PROTECTED]> wrote: > > One reason attention is going to PyPy instead of Psyco... > > > Jean-Paul > > I had a look at PyPy, it, indeed, have a very long way to go so we can > consider it an alternative. To see how it´s going, you can check this out: http://more

Re: object-relational mappers

2008-04-03 Thread Luis M . González
also resort to plain sql as follows: db.query('select * from customers where name = "John"'). Simple, effective and doesn't get in your way. Luis -- http://mail.python.org/mailman/listinfo/python-list

Re: object-relational mappers

2008-04-03 Thread Luis M . González
asy to do, without having to mess with objects. I think this sticks strictly to the KISS principle, keeping it simple, with less overhead, less layers of abstraction and therefore, less bugs and complications. And it matchs perfectly webpy's philosofy for creating web apps. Luis On 3 abr, 11

Re: object-relational mappers

2008-04-03 Thread Luis M . González
On 3 abr, 11:06, Bruno Desthuilliers wrote: > Luis M. González a écrit : > > > I have come to the same conclusion. > > ORMs make easy things easier, but difficult things impossible... > > Not my experience with SQLAlchemy. Ok, I still not had an occasion to > test i

Re: Replace reduce with listcomprehension?

2008-08-25 Thread Luis M . González
om/weblogs/viewpost.jsp?thread=98196 Luis On Aug 25, 7:08 pm, ssecorp <[EMAIL PROTECTED]> wrote: > GvR wants to eliminate all the functional stuff (lambda map reduce > filter) which kind of makes sense for Python, listcomprehensions are > more efficient(at least as implemented i

Re: Replace reduce with listcomprehension?

2008-08-25 Thread Luis M . González
Don't use these with a lambda though; then a list comprehension is clearer and faster.) So it seems only reduce will be eliminated. Luis -- http://mail.python.org/mailman/listinfo/python-list

Re: Python - ubuntu

2008-08-29 Thread Luis M . González
It's worth noting that Ubuntu's creator is a fan of python. So it comes as no surprise that the distribution has a lot of components written in this language. Also, and as far as I know, the use of python is encouraged for making contributions. On Aug 29, 11:57 am, azrael <[EMAIL PROTECTED]> wrot

Re: New python.org site

2006-03-11 Thread Luis M. González
I wouldn't want to sound like I'm criticizing other people's work. To those who offered their time to create this site, which is quite an improvement over the old one, thank you! However, I like the idea of a contest. Both for the site and for the logo. Perhaps something cool could come up from th

Re: New-style Python icons

2006-03-21 Thread Luis M. González
This is strange... I've been trying to access this site since yesterday, but I couldn't (Firefox can't stabilish connection with server www.doxdesk.com). However, I seem to be the only one with this problem... -- http://mail.python.org/mailman/listinfo/python-list

PyPy is now able to compile efficient extension modules!

2006-03-26 Thread Luis M. González
"PyPy is now able to compile efficient extension modules!". This was recently announced by Christian Tismer on Pypy's mailing list. To learn more: http://codespeak.net/pipermail/pypy-dev/2006q1/002911.html -- http://mail.python.org/mailman/listinfo/python-list

New Karrigel page in Wikipedia

2006-04-12 Thread Luis M. González
For those interested in the simplest, easiest and most pythonic web framework out there, there's a new page in Wikipedia: http://en.wikipedia.org/wiki/Karrigell -- http://mail.python.org/mailman/listinfo/python-list

Re: Python2CPP ?

2006-04-12 Thread Luis M. González
You should check Shed Skin (Python-to-C++ Compiler): http://shed-skin.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: New Karrigel page in Wikipedia

2006-04-13 Thread Luis M. González
When you talk about the "Karrigell folks" it looks like there's a bunch of guys out there ploting to rule the world. It's nothing like that. I just read Pierre's comments about this article, and decided to post a message in comp.lang.python to let everybody know about it. Perhaps my post looked li

Re: Should I learn Python instead?

2006-04-14 Thread Luis M. González
First of all, let me tell you that you can now write apps for .NET with Python. There's a python implementation for the .NET framework called Ironpython (in beta 5 now). Regarding XML, I can't tell you much but in general, python is much easier, cleaner, concise and intuitive than all the other al

Re: High-performance Python websites

2009-11-26 Thread Luis M . González
nds without having to change anyting from your part. Simply code correctly your site in python or java, using Django or any other wsgi compliant framework, and you are set to go. Check it out: http://code.google.com/appengine/docs/whatisgoogleappengine.html Luis -- http://mail.python.org/mailman/listinfo/python-list

Re: When will Python 3 be fully deployed

2009-12-06 Thread Luis M . González
On Dec 6, 3:21 pm, vsoler wrote: > I recently read that many libraries, including Numpy have not been > ported to Python 3. > > When do you think that Python 3 will be fully deployed? > > Should I stick, so far, to Python 2.6? > > Regards > > Vicente Soler You'll have some answers here: http://j

Re: Java-to-Python?

2009-12-18 Thread Luis M . González
On Dec 18, 11:44 am, Virgil Stokes wrote: > I have a rather large Java package for the analysis of networks that I > would like to convert to Python. Many of the classes in the Java package > are "Serializable". > > Any recommendations on Java-to-Python (2.6) would be appreciated. > > --V Have yo

Re: What is a list compression in Python?

2010-01-20 Thread Luis M . González
On Jan 18, 1:07 pm, Kit wrote: > Hello Everyone, I am not sure if I have posted this question in a > correct board. Can anyone please teach me: > > What is a list compression in Python? > > Would you mind give me some list compression examples? > > Thanks & really appreciate that. > Kit It's also

Re: python 3's adoption

2010-01-28 Thread Luis M . González
> Please don't post more noise and ad hominem attacks to the group, Steve. "Ad hominem"? Please, operor non utor lingua non notus per vulgaris populus. Gratias ago vos... -- http://mail.python.org/mailman/listinfo/python-list

Re: What happened to pyjamas?

2010-02-19 Thread Luis M . González
On Feb 18, 5:21 pm, Daniele Gondoni wrote: > On 18 Feb, 19:58, "[email protected]" wrote: > > > Down from here (NH, US). > > > S > > > On Feb 18, 2010, at 1:44 PM, Chris Colbert wrote: > > Unreacheable from Italy as well... Same here (Buenos Aires, Argentina). -- http://mail.python.org/mailma

Re: Creating variables from dicts

2010-02-23 Thread Luis M . González
). So going back to your question, you should have two lists, as follows: n = ['a', 'm', 'p'] v = [1,3,7] --> note that I used brackets [], not curly braces {}. And now you can build a dict formed by the keys in "n" and the values in "v": myDict = {} --> this is an new empty dictionary for k,v in zip(n,v): myDict[k] = v This results in this dictionary: {'a': 1, 'p': 7, 'm': 3}. Hope this helps... Luis -- http://mail.python.org/mailman/listinfo/python-list

Re: Creating variables from dicts

2010-02-23 Thread Luis M . González
On Feb 23, 7:56 pm, Luis M. González wrote: > On Feb 23, 5:53 pm, vsoler wrote: > > > > > > > Hi, > > > I have two dicts > > > n={'a', 'm', 'p'} > > v={1,3,7} > > > and I'd like to have > >

Re: Creating variables from dicts

2010-02-23 Thread Luis M . González
On Feb 23, 10:41 pm, Steven D'Aprano wrote: > On Tue, 23 Feb 2010 15:41:16 -0800, Luis M. González wrote: > > By the way, if you want the variables inside myDict to be free > > variables, you have to add them to the local namespace. The local > > namespace is also a dic

Re: Creating variables from dicts

2010-02-23 Thread Luis M . González
On Feb 24, 1:15 am, Steven D'Aprano wrote: > On Tue, 23 Feb 2010 19:47:22 -0800, Luis M. González wrote: > > On Feb 23, 10:41 pm, Steven D'Aprano > > wrote: > >> On Tue, 23 Feb 2010 15:41:16 -0800, Luis M. González wrote: > >> > By the way, if y

Re: Creating variables from dicts

2010-02-24 Thread Luis M . González
On Feb 24, 4:08 am, Steven D'Aprano wrote: > On Tue, 23 Feb 2010 20:44:10 -0800, Luis M. González wrote: > > On Feb 24, 1:15 am, Steven D'Aprano > > wrote: > >> On Tue, 23 Feb 2010 19:47:22 -0800, Luis M. González wrote: > >> > On Feb 23, 10:41 pm,

Re: Creating variables from dicts

2010-02-24 Thread Luis M . González
On Feb 24, 7:44 am, Luis M. González wrote: > On Feb 24, 4:08 am, Steven D'Aprano > > > > > > wrote: > > On Tue, 23 Feb 2010 20:44:10 -0800, Luis M. González wrote: > > > On Feb 24, 1:15 am, Steven D'Aprano > > > wrote: > >

Re: Creating variables from dicts

2010-02-24 Thread Luis M . González
On Feb 24, 8:48 am, Bruno Desthuilliers wrote: > Luis M. Gonz lez a crit : > (snip) > > > Alright, this is what the docs say about locals: > > "Note > > The built-in functions globals() and locals() return the current > > global and local dictionary, res

Re: to create variable from dict

2010-03-12 Thread Luis M . González
ue be '1' etc. > > Pl. suggest. > > Thank you. Check out this thread (very recent): http://groups.google.com/group/comp.lang.python/browse_thread/thread/bb1797ffb6fc3bd7/25fe94103c7a231f?lnk=gst&q=luis+variables#25fe94103c7a231f Short answer: you can update globals() wit

Re: Best Way to extract Numbers from String

2010-03-20 Thread Luis M . González
On Mar 20, 12:04 am, Jimbo wrote: > Hello > > I am trying to grab some numbers from a string containing HTML text. > Can you suggest any good functions that I could use to do this? What > would be the easiest way to extract the following numbers from this > string... > > My String has this layout

Re: DreamPie - The Python shell you've always dreamed about!

2010-03-22 Thread Luis M . González
On Feb 21, 6:40 pm, Mensanator wrote: > On Feb 21, 12:14 pm, Paul Boddie wrote: > > > > > > > On 21 Feb, 17:32, Mensanator wrote: > > > > On Feb 21, 10:30 am, Mensanator wrote: > > > > > What versions of Python does it suuport? > > > > What OS are supported? > > > From the Web site referenced i

OT: Meaning of "monkey"

2010-03-26 Thread Luis M . González
Webmonkey, Greasemonkey, monkey-patching, Tracemonkey, Jägermonkey, Spidermonkey, Mono (monkey in spanish), codemonkey, etc, etc, etc... Monkeys everywhere. Sorry for the off topic question, but what does "monkey" mean in a nerdy-geek context?? Luis -- http://mail.python.org/mailma

Re: Classes as namespaces?

2010-03-26 Thread Luis M . González
On 26 mar, 11:49, kj wrote: > What's the word on using "classes as namespaces"?  E.g. > > class _cfg(object): >     spam = 1 >     jambon = 3 >     huevos = 2 > > breakfast = (_cfg.spam, _cfg.jambon, _cfg.huevos) I see no problem. I wouldn't mix English, French and Spanish in the same recipe thou

Re: Python 3.2 beta 2

2010-12-21 Thread Luis M . González
I wonder if Unladen Swallow is still being considered for merger with Python 3.3. Is it? On Dec 21, 4:18 pm, Georg Brandl wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On behalf of the Python development team, I'm happy to announce the > second beta preview release of Python 3.2.

Re: Which is the best book to learn python

2011-01-25 Thread Luis M . González
ce, you may look to something more advanced, such as "Dive into Python". All these resources are available online for free. If you want to but a book, I like "Beginning Python: From Novice to Professional". Hope this helps... Luis -- http://mail.python.org/mailman/listinfo/python-list

Re: Which is the best book to learn python

2011-01-27 Thread Luis M . González
.htm > > and stop when they start to talk about VBscript :) > > JM I strongly second this suggestion. Alan Gauld's example of a banking application was just what I needed to finally understand object oriented programming. This is how my head made the "click". Luis -- http://mail.python.org/mailman/listinfo/python-list

Re: Would like to add an "upload" facility to my web site

2011-01-31 Thread Luis M . González
On Jan 31, 1:50 pm, Ramon F Herrera wrote: > On Jan 31, 10:49 am, Ramon F Herrera wrote: > > > > > > > > > > > (newbie alert) > > > This is what I have so far: > > >http://patriot.net/~ramon/upload_facility.html > > > The code is shown below. It seems I need that actual script that > > performs t

per-method jit compiler

2010-04-05 Thread Luis M . González
;: , 'b': , 'd': } So by using this information, we record all the argument types used the first time each function/method is executed, and then we generate optimized code for them. >From this point on, a guard should check if all arguments remain the same and, if so, the optimized code is run. Otherwise, just fall back to the interpreter. He! I have no idea how to implement it... Any guru out there? Luis -- http://mail.python.org/mailman/listinfo/python-list

per-method jit compiler

2010-04-05 Thread Luis M . González
y using this information, we record all the argument types used the first time each function/method is executed, and then we generate optimized code for them. >From this point on, a guard should check if all arguments remain the same and, if so, the optimized code is run. Otherwise, just fall back to the interpreter. He! I have no idea how to implement it... Any guru out there? Luis -- http://mail.python.org/mailman/listinfo/python-list

per-function jit compiler

2010-04-05 Thread Luis M . González
back to the interpreter. He! I have no idea how to implement it... Any guru out there? Luis -- http://mail.python.org/mailman/listinfo/python-list

Re: per-function jit compiler

2010-04-06 Thread Luis M . González
On 6 abr, 03:40, Chris Rebert wrote: > 2010/4/5 Luis M. González : > > > > > > > This post gave me an > > idea:http://groups.google.com/group/comp.lang.python/msg/5d75080707104b76 > > > What if I write a simple decorator to figure out the types of every >

Re: Write web apps in Python?

2010-04-12 Thread Luis M . González
ed quotas on bandwith and data used (which are quite generous). You don't need to set up anything. All you need is a google account to get started. Luis -- http://mail.python.org/mailman/listinfo/python-list

Re: Is Python a functional programming language?

2010-05-10 Thread Luis M . González
nLisp.html That doesn't mean python can compete with other purely functional languages, but it's probably as functional as it can be for a more conventional, multiparadigm language. Luis -- http://mail.python.org/mailman/listinfo/python-list

Re: Lua is faster than Fortran???

2010-07-04 Thread Luis M . González
at length. Pay special attention to Mike Pall's comments (he is the creator of Luajit) and his opinion about python and pypy. You will read also about other projects, specially new javascript engines such as Mozila's Tracemonkey (the authors participate in this thread) and the pypy folks. It is a very good read for anyone interested in the subject. Very recommended! Good luck! Luis -- http://mail.python.org/mailman/listinfo/python-list

Re: Lua is faster than Fortran???

2010-07-04 Thread Luis M . González
On Jul 4, 4:51 pm, Luis M. González wrote: > On Jul 4, 12:30 am, sturlamolden wrote: > > > > > > > I was just looking at Debian's benchmarks. It seems LuaJIT is now (on > > median) beating Intel Fortran! > > > C (gcc) is running the benchmarks faste

Re: The real problem with Python 3 - no business case for conversion (was "I strongly dislike Python 3")

2010-07-06 Thread Luis M . González
On Jul 2, 4:07 pm, John Nagle wrote: > David Cournapeau wrote: > > I think one point which needs to be emphasized more is what does > > python 3 bring to people. The" what's new in python 3 page" gives > > the impression that python 3 is about removing cruft. That's a very > > poor argument to pu

Re: Lua is faster than Fortran???

2010-07-08 Thread Luis M . González
On Jul 4, 5:58 pm, John Nagle wrote: >     TheUnladenSwallowpeople should in theory be able to reach > that level of performance.  (Both groups are employed at Google. > So their effectiveness will be compared.) > >                                 John Nagle No. Collin Winter said that they will

Re: How is Unladen Swallow coming along?

2010-07-08 Thread Luis M . González
're now about 6 months behind their project > plan. > > ("http://code.google.com/p/unladen-swallow/wiki/ProjectPlan";) > >                                         John Nagle Don't be shy. Ask this question in Unladen Swallow's google group. They don't bite! Luis -- http://mail.python.org/mailman/listinfo/python-list

Re: How is Unladen Swallow coming along?

2010-07-08 Thread Luis M . González
On Jul 8, 5:44 pm, John Nagle wrote: > On 7/8/2010 12:19 PM, Luis M. González wrote: > > > On Jul 8, 1:42 pm, John Nagle  wrote: > >>      How is Unladen Swallow coming along?  Looking at the site, code is > >> being checked in and issues are being reported, but t

Re: Lua is faster than Fortran???

2010-07-13 Thread Luis M . González
ing with Lua, you wish you had all the missing python features. I see Lua as a some sort of minimal Python. It looks like a simplified subset of python. Being simpler, it's also easier to implement efficiently. Note that Lua was created a simple language to be embedded into larger applications written in c or c++. So it doesn't need a standard library, since you would be using libraries built for the main aplication, written in c or c++. However it worth noting that, according to Mike Pall (the creator of Luajit), there's no reason to believe Python could not be as fast a Luajit. It has no show stoppers. It would simply require much more work around its corner cases, being the main difficulties in python's own environment, not in the core language. This is all explained in the above mentioned thread on tracing jits... Luis -- http://mail.python.org/mailman/listinfo/python-list

MemoryError c/vcompiler.h:745: Fatal Python error (Psycopg2)

2009-06-21 Thread Luis P. Mendes
M I could not find this error. What does this mean? Is this a bug of Python? of Psycopg2? Luis -- http://mail.python.org/mailman/listinfo/python-list

Re: MemoryError c/vcompiler.h:745: Fatal Python error (Psycopg2)

2009-06-21 Thread Luis P. Mendes
Sun, 21 Jun 2009 13:04:59 +, Lie Ryan escreveu: > Luis P. Mendes wrote: >> Hi, >> >> I have a program that uses a lot of resources: memory and cpu but it >> never returned this error before with other loads: >> >> """ >> Memory

Psyco 64 bits

2009-07-09 Thread Luis P. Mendes
PyPy. But I don't know how to use it. With psyco, I used to include two statements roughly at the beginning of the script: import psyco psyco.full() With PyPy, is there a similar way to try to speed up my script? Luis -- http://mail.python.org/mailman/listinfo/python-list

Convert points to polygon shapefile

2009-07-24 Thread Luis Pedro Almeida
Dear all, I would like to know how to convert a list of points into a polygon shapefile (esri). Thanks! Best regards, Luis Pedro Almeida -- http://mail.python.org/mailman/listinfo/python-list

urllib with x509 certs

2014-05-16 Thread Luis Miguel Rojas Aguilera
Hi, i tried what you suggest but still asking me for the password, this time twice. Please i need help so this is for my thesis. VII Escuela Internacional de Verano en la UCI del 30 de junio al 11 de julio de 2014. Ver www.uci.cu -- https://mail.python.org/mailman/listinfo/python-list

Problems with regular expressions

2007-06-14 Thread Carlos Luis Pérez Alonso
I have the next piece of code: if re.search('^(taskid|bugid):\\d+',logMessage): return 0 else: sys.stderr.write("El comentario tiene que contener el taskid: o el bugid:") return

distutils, No module named numpy.distutils.fcompiler.conv_template

2009-03-30 Thread Luis Alberto Zarrabeitia Gomez
.py", line 405, in import_module m = self.load_tail(q, tail) File "/usr/lib/python2.5/ihooks.py", line 458, in load_tail raise ImportError, "No module named " + mname ImportError: No module named numpy.distutils.fcompiler.conv_template -- Luis Zarr

Re: python needs leaning stuff from other language

2009-04-02 Thread Luis Alberto Zarrabeitia Gomez
iving as the current .writelines(). BTW, check out the print statement from python2, and the print function in python3: >>> print >>fileobj, "this will print with an eol" # python2 >>> print("this will print with an eol", file=fileobj) --

Re: python needs leaning stuff from other language

2009-04-02 Thread Luis Alberto Zarrabeitia Gomez
a list instead of creating an empty one, its likely that someone is facing one of those problems (i.e: clearing a list that you got as a function argument, or playing with os.walk). -- Luis Zarrabeitia Facultad de Matemática y Computación, UH http://profesores.matcom.uh.cu/~kyrie -- Participe en

Re: nested looping

2009-04-08 Thread Luis Alberto Zarrabeitia Gomez
n alist if not any(alpha + xy in checklist for xy in xlist)] (remember, all of this is untested) -- Luis Zarrabeitia Facultad de Matemática y Computación, UH http://profesores.matcom.uh.cu/~kyrie -- Participe en Universidad 2010, del 8 al 12 de febrero de 2010 La Habana, Cuba http://www.universidad2010.cu -- http://mail.python.org/mailman/listinfo/python-list

Re: any(), all() and empty iterable

2009-04-11 Thread Luis Alberto Zarrabeitia Gomez
if not element: return False return True You may also want to look at [3] K. P.S: Forgive my english. I'm falling asleep... I hope I made sense. [1] http://en.wikipedia.org/wiki/Existential_quantification [2] http://en.wikipedia.org/wiki/Universal_quantification [3

Re: Imports in python are static, any solution?

2009-04-13 Thread Luis Alberto Zarrabeitia Gomez
t 10 May I ask, why is it problematic? You should be avoiding the use of global variables anyway. -- Luis Zarrabeitia Facultad de Matemática y Computación, UH http://profesores.matcom.uh.cu/~kyrie -- Participe en Universidad 2010, del 8 al 12 de febrero de 2010 La Habana, Cuba http://www.univ

Re: any(), all() and empty iterable

2009-04-14 Thread Luis Alberto Zarrabeitia Gomez
's possible people out there depend on the present behaviour. It's more than that. Python's following the rules here. Maybe it could be documented better, for those without a background in logic/discrete mathematics, but not changed. -- Luis Zarrabeitia Facultad de Matemática y Com

Re: sorting two corresponding lists?

2009-04-20 Thread Luis Alberto Zarrabeitia Gomez
s[:] = " instead of "values = " on the first option to simulate a sort_in_place. I usually prefer the first form. -- Luis Zarrabeitia Facultad de Matemática y Computación, UH http://profesores.matcom.uh.cu/~kyrie -- Luis Zarrabeitia Facultad de Matemática y Computación, UH htt

Re: Multiprocessing.Queue - I want to end.

2009-05-03 Thread Luis Alberto Zarrabeitia Gomez
Quoting Hendrik van Rooyen : > "Luis Zarrabeitia" wrote: > > 8< ---explanation and example of one producer, > 8< ---more consumers and one queue > > >As you can see, I'm sending one 'None' per consumer,

Re: Multiprocessing.Queue - I want to end.

2009-05-03 Thread Luis Alberto Zarrabeitia Gomez
queue itself... Well, Cameron Simpson did :D. It's working nicely now. -- Luis Zarrabeitia Facultad de Matemática y Computación, UH http://profesores.matcom.uh.cu/~kyrie -- Participe en Universidad 2010, del 8 al 12 de febrero de 2010 La Habana, Cuba http://www.universidad2010.cu -- http://mail.python.org/mailman/listinfo/python-list

Re: Multiprocessing.Queue - I want to end.

2009-05-05 Thread Luis Alberto Zarrabeitia Gomez
for item in iterq: > | ... > | The producer calls iterq.close() when it's done. > > Someone asked, so code appended below. > [...] Thank you!. I tested it, and it seems to work... and having the queue be an iterable is a plus. Thank you, Cameron & MRAB! -- Luis Zarrabeitia F

Re: Self function

2009-05-06 Thread Luis Alberto Zarrabeitia Gomez
just because there are ways to do more work and hopefully avoid the problems. I'd say that the "problem" is even aggravated in python, where the dynamic nature of the language makes it near to impossible to build good refactoring tools) -- Luis Zarrabeitia Facultad de Matemática y

Re: Self function

2009-05-06 Thread Luis Alberto Zarrabeitia Gomez
luding the still unexistent but already know function name, would guarantee that at least recursion calls the same function instead of "whatever happens to be bound to their name at runtime". If it wasn't a hack, anyway. -- Luis Zarrabeitia Facultad de Matemática y Computación, UH

Re: pushback iterator

2009-05-17 Thread Luis Alberto Zarrabeitia Gomez
on't mind doing instead: f = file(something) rest = parse_headers(f) rest = parse_body(rest) rest = parse_footer(rest) you could return itertools.chain([pushed_back], iterator) from your parsing functions. Unfortunately, this way will add another layer of itertools.chain on top of the iterator

Re: Adding a Par construct to Python?

2009-05-20 Thread Luis Alberto Zarrabeitia Gomez
Quoting Carl Banks : > On May 20, 4:07 pm, Luis Zarrabeitia wrote: > > On Wednesday 20 May 2009 06:16:39 pm Aahz wrote: > > The designers of Python made a design decision(**) that extension > writers would not have to take care of locking. They could have made > a dif

Re: Adding a Par construct to Python?

2009-05-21 Thread Luis Alberto Zarrabeitia Gomez
Quoting Carl Banks : > I don't have any reply to this post except for the following excerpts: > > On May 20, 8:10 pm, Luis Alberto Zarrabeitia Gomez > wrote: > > 2- in [almost] every other language, _you_ have to be aware of the > critical > > sections when mul

Re: id( ) function question

2009-10-14 Thread Luis Alberto Zarrabeitia Gomez
he first one (now dereferenced and deallocated) used, so > CPython gives it the same id value. Wow, I never thought about it, but at least in my system, it seems to work like that: In [6]: id({1:2}) == id({3:4}) Out[6]: True Interesting... (only as a curiosity, though... One shouldn't re

Re: Most efficient way to "pre-grow" a list?

2009-11-07 Thread Luis Alberto Zarrabeitia Gomez
Quoting Bruno Desthuilliers : > > Another situation where one may want to do this is if one needs to > > initialize a non-sparse array in a non-sequential order, > > Then use a dict. Ok, he has a dict. Now what? He needs a non-sparse array. -- Luis Zarrabeitia Facult

Re: Most efficient way to "pre-grow" a list?

2009-11-07 Thread Luis Alberto Zarrabeitia Gomez
Quoting Andre Engels : > On Sat, Nov 7, 2009 at 8:25 PM, Luis Alberto Zarrabeitia Gomez > wrote: > > > > Ok, he has a dict. > > > > Now what? He needs a non-sparse array. > > Let d be your dict. > > Call the zeroeth place in your array d[0], the first

Re: Dictionary or Database—Please advise

2010-02-26 Thread Luis M . González
ything, since it's not a database server. You simply save your databases as files. If you don't know sql (the standard language used to query databases), I recomend this online tutorial: http://www.sqlcourse.com/ Good luck! Luis -- http://mail.python.org/mailman/listinfo/python-list

Re: Exotic Logics

2009-06-17 Thread Luis Alberto Zarrabeitia Gomez
floor, but that doesn't matter. From the user's perspective, there would be only functions: no strings, no objects, no numbers. That reminds me of my last class (disclaimer: I teach discrete math). I told my students "well, let's assume that numbers exist", and I wasn'

Re: missing 'xor' Boolean operator

2009-07-16 Thread Luis Alberto Zarrabeitia Gomez
boolean - if you don't need anything else, treat it as such -, but it will be, whenever is possible, one of the objects in the sequence, in case you need more info. > without > trying to find any intuitive/natural/obvious logic in it, knowing that > sometimes the Truth lies far

Re: Help understanding the decisions *behind* python?

2009-07-22 Thread Luis Alberto Zarrabeitia Gomez
ack on this thread and look at them. heights = {} heights[1,2] = 5 heights[1,3] = 7 heights[3,5] = 1 addresses[lastname, firstname] = my_home_address census[location, age] = census.get((location, age), 0) + 1 All those are using tuples as dict keys. Regards, -- Luis Zarrabeiti

Re: initializing with empty list as default causes freaky problems

2009-07-28 Thread Luis Alberto Zarrabeitia Gomez
uages do it? I've spent so much time with python that reevaluating the default argument on invocation feels clumsy, but I'm obviously tainted now...] Regards, -- Luis Zarrabeitia Facultad de Matemática y Computación, UH http://profesores.matcom.uh.cu/~kyrie -- Partici

Re: Subclass dynamically

2009-08-08 Thread Luis Alberto Zarrabeitia Gomez
and return the instance). 3- You may want to take a look at metaclasses. But without more details about why you want it, I can't give you more precise answers. Regards, -- Luis Zarrabeitia Facultad de Matemática y Computación, UH http://profesores.matcom.uh.cu/~kyrie -- Participe en U

list as an instance attribute

2009-09-12 Thread Daniel Luis dos Santos
Hello, I have an object definition : class primitive: def __init__(self) self.name = "" self.transforms = [] def copy(self, copyName) copy = self.copyInternalState(copyName) # method defined elsewhere in derived class if se

<    1   2   3   4   5   6