Re: Type hinting of Python is just a toy ?

2019-01-04 Thread lorenzo . gatti
On Friday, January 4, 2019 at 9:05:11 AM UTC+1, iam...@icloud.com wrote: > I read that pep 484 type hinting of python has no effect of performance, then > what’s the purpose of it? Just a toy ? Having no effect on performance is a good thing; Python is already slowish, additional runtime type che

Re: Are the critiques in "All the things I hate about Python" valid?

2018-02-21 Thread lorenzo . gatti
On Saturday, February 17, 2018 at 12:28:29 PM UTC+1, Ben Bacarisse wrote: > Marko Rauhamaa writes: > > > Many people think static typing is key to high quality. I tend to think > > the reverse is true: the boilerplate of static typing hampers > > expressivity so much that, on the net, quality suf

Re: Getting back into PyQt and not loving it.

2016-06-27 Thread lorenzo . gatti
PyGTK is obsolete and stopped at Python 2.7, while PyGObject for Windows is several versions behind (currently 3.18 vs 3.21) and it doesn't support Python 3.5. Game over for GTK+. -- https://mail.python.org/mailman/listinfo/python-list

Re: Which one is the best XML-parser?

2016-06-24 Thread lorenzo . gatti
On Thursday, June 23, 2016 at 11:03:18 PM UTC+2, David Shi wrote: > Which one is the best XML-parser? > Can any one tell me? > Regards. > David Lxml offers lxml.etree.iterparse (http://lxml.de/tutorial.html#event-driven-parsing), an important combination of the memory savings of incremental pars

Re: anomaly

2015-05-11 Thread lorenzo . gatti
ys. Both choices are perfectly good, and routinely made without bothering other people with inane conversations. Lorenzo Gatti -- https://mail.python.org/mailman/listinfo/python-list

Re: New user's initial thoughts / criticisms of Python

2013-11-11 Thread lorenzo . gatti
Regarding the "select" statement, I think the most "Pythonic" approach is using dictionaries rather than nested ifs. Supposing we want to decode abbreviated day names ("mon") to full names ("Monday"): day_abbr='mon' day_names_mapping={ 'mon':'Monday', 'tue':'Tuesday', 'wed':'Wednesd

Re: Choosing GUI Module for Python

2009-11-12 Thread Lorenzo Gatti
On Nov 11, 9:48 am, Lorenzo Gatti wrote: > On a more constructive note, I started to follow the instructions > athttp://www.pyside.org/docs/pyside/howto-build/index.html(which are > vague and terse enough to be cross-platform) with Microsoft VC9 > Express. > Hurdle 0: recompile

Re: Choosing GUI Module for Python

2009-11-11 Thread Lorenzo Gatti
n't be resumed) after about 2 hours: trial and error at 1-2 builds per day could take weeks. Regards, Lorenzo Gatti -- http://mail.python.org/mailman/listinfo/python-list

Re: Choosing GUI Module for Python

2009-11-10 Thread Lorenzo Gatti
oject underway to produce > PyQT compatible LGPL python bindings under the PySide project. I also would like to use PySide, but unlike PyQt and Qt itself it doesn't seem likely to support Windows in the foreseeable future. A pity, to put it mildly. Regards, Lorenzo Gatti -- http://mail.py

Re: Pyfora, a place for python

2009-11-04 Thread Lorenzo Gatti
On Nov 3, 11:37 am, Steven D'Aprano wrote: > On Tue, 03 Nov 2009 02:11:59 -0800, Lorenzo Gatti wrote: [...] > Are you saying that now that comp.lang.python and stackoverflow exists, > there no more room in the world for any more Python forums? > > I think that's terri

Re: Pyfora, a place for python

2009-11-03 Thread Lorenzo Gatti
g fish in a small pond over being part of a community. If you want to claim a small Python-related corner of the web, you should write a blog: if it is any good, and probably even if it isn't, it would be linked and read by someone and it would add to collective knowledge instead of fragmentin

Re: random number including 1 - i.e. [0,1]

2009-06-10 Thread Lorenzo Gatti
you multiply or divide these coefficients by (N-1)/N the minimum and maximum results for the two choices can be made identical up to floating point mangling. Regards, Lorenzo Gatti -- http://mail.python.org/mailman/listinfo/python-list

Re: Thoughts on language-level configuration support?

2009-03-31 Thread Lorenzo Gatti
s central and actual use and design is a second class citizen. You say in your blog post: "Users shouldn’t have to pore through the code to find all the little bits they can tweak". They shouldn't because a well designed application has adequate documentation of what should be configured in the form of manuals, wizards, etc. and they shouldn't because they don't want to tweak little bits, not even if they have to. Regards, Lorenzo Gatti -- http://mail.python.org/mailman/listinfo/python-list

Re: type-checking support in Python?

2008-10-07 Thread Lorenzo Gatti
types. In C++ one can check dimensions at compile time (http://www.boost.org/ doc/libs/1_36_0/doc/html/boost_units.html) with a modest increase of cumbersomeness, but Python would need very heavyweight classes containing a value and its dimension and a replacement of all needed functions and operat

Re: XML-schema 'best practice' question

2008-09-20 Thread Lorenzo Gatti
s are that the needed objects are already in place and you only need to make workflow more explicit and add appropriate new features. Regards, Lorenzo Gatti -- http://mail.python.org/mailman/listinfo/python-list

Re: XML-schema 'best practice' question

2008-09-20 Thread Lorenzo Gatti
graphical output something simpler than an editor (e.g a Graphviz exporter) might be enough. 3) Maybe workflow processing can grow inside your existing accounting application without the sort of "big bang" redesign you seem to be planning; chances are that the needed objects are already

Re: XML-schema 'best practice' question

2008-09-18 Thread Lorenzo Gatti
e you performed validation) you can also store the filled-in document that you computed, either as XML or as serialized Python data structures. Regards, Lorenzo Gatti -- http://mail.python.org/mailman/listinfo/python-list

Re: 2d graphics - what module to use?

2008-07-25 Thread Lorenzo Gatti
glVertex2f(x,y) glEnd() app.run() Regards, Lorenzo Gatti -- http://mail.python.org/mailman/listinfo/python-list

Re: str(bytes) in Python 3.0

2008-04-12 Thread Lorenzo Gatti
de with lenient APIs is the only way forward; being forced to learn that encodings are important is better than, say, discovering unrecoverable data corruption in a working system. Regards, Lorenzo Gatti -- http://mail.python.org/mailman/listinfo/python-list

Re: Beginner's assignment question

2008-03-01 Thread Lorenzo Gatti
overlaps between the left-hand side and the right-hand side are `safe' (for example "a, b = b, a" swaps two variables), overlaps within the collection of assigned-to variables are not safe! For instance, the following program prints "[0, 2]": x = [0, 1] i = 0 i, x[i] = 1, 2 print x Lorenzo Gatti -- http://mail.python.org/mailman/listinfo/python-list

Re: pytz has so many timezones!

2007-10-08 Thread gatti
re many but nicely alphabetized, and map the country to its only timezone, or for the few large countries with more than a TZ offer a choice later. Lorenzo Gatti -- http://mail.python.org/mailman/listinfo/python-list

Re: sorteddict [was a PEP proposal, but isn't anymore!]

2007-09-27 Thread gatti
tainers (http:// www.boost.org/libs/multi_index). The only differences with dict should be the constraint that items(), keys(), values(), iteritems(), iterkeys(), itervalues() return entries sorted by key. Regards, Lorenzo Gatti -- http://mail.python.org/mailman/listinfo/python-list

Re: Eclipse/PyDev question

2007-08-13 Thread gatti
g of a GUI application, about 6 JUnit tests, about 3 command line tools with many complex parameter sets each, and some Ant builds; it would take about one hour of trial and error to reconstruct the command lines, classpaths and JVM options. I only run the current file as a draft for an edited configu

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-16 Thread gatti
Martin v. Lowis wrote: > Lorenzo Gatti wrote: >> Not providing an explicit listing of allowed characters is inexcusable >> sloppiness. > That is a deliberate part of the specification. It is intentional that > it does *not* specify a precise list, but instead defers that lis

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-14 Thread gatti
> nonspacing marks (Mn), spacing combining marks (Mc), decimal number > (Nd), and connector punctuations (Pc). Am I the first to notice how unsuitable these characters are? Many of these would be utterly invisible ("variation selectors" are Mn) or displayed out of sequence (overlay

Re: parse HTML by class rather than tag

2007-02-23 Thread gatti
ibly brittle idea. Use a robust HTML parser (e.g. http://www.crummy.com/software/BeautifulSoup/) to build a document tree, then visit it top down and look at the value of the 'class' attributes. Regards, Lorenzo Gatti -- http://mail.python.org/mailman/listinfo/python-list

Re: Overloading the tilde operator?

2007-02-08 Thread gatti
ours of Prolog, as descrived in the classic book by Clocksin & Mellish. Regarding the OP, I hope his need for an infix tilde operator is overestimated; there are plenty of infix operators that can be abused, and at least one of them should be unused and available for redefinition. Lorenzo Gatti -- http://mail.python.org/mailman/listinfo/python-list

Re: Do I need Python to run Blender correctly?

2007-01-25 Thread gatti
On Jan 25, 9:25 am, "AKA gray asphalt" <[EMAIL PROTECTED]> wrote: > I downloaded Blender but there was no link for python. Am I on the right > track? Don't worry, Blender includes its own bundled Python interpreter, which is usually one version behind; just lea

Re: How to get the "longest possible" match with Python's RE module?

2006-09-13 Thread gatti
e a fixed match length. Which is the longest of, for example, /(abc)?def/ and /(def)?ghi/ depends on the input. Lorenzo Gatti -- http://mail.python.org/mailman/listinfo/python-list

Re: How to get the "longest possible" match with Python's RE module?

2006-09-12 Thread gatti
bottom-up context-free language parsing like Earley or Tomita's algorithms; for reasonable languages most locations can be excluded for most rules at the beginning, with great performance improvements over trying over and over again. Lorenzo Gatti -- http://mail.python.org/mailman/listinfo/python-list

Re: How to get the "longest possible" match with Python's RE module?

2006-09-12 Thread gatti
ic way to deal with these corner cases was available, and unsystematic ways (with greedy and reluctant quantifiers) were too complex. I ended up eliminating regular expressions completely and building a dynamic programming parser that returns the set of all match lengths; it wasn't hard an

Re: Text Summarization

2006-07-19 Thread gatti
Jim Jones wrote: > Is there a Python library that would allow me to take a paragraph of text, > and generate a one or two sentence summary of that paragraph? There is a OTS wrapper. -- http://mail.python.org/mailman/listinfo/python-list

propagating distutil user options between commands

2005-10-10 Thread gatti
reasons for the current strict policy in Distutils? Can it be changed? Lorenzo Gatti -- http://mail.python.org/mailman/listinfo/python-list

Re: Which kid's beginners programming - Python or Forth?

2005-06-28 Thread gatti
stroke model like Postscript's and a whole world of other things. There are many complex features in Python that shouldn't be introduced before the need arises. List comprehensions, however, *are* the basic control flow; loops are much more verbose and they should be used only when necessa

Re: Favorite non-python language trick?

2005-06-24 Thread gatti
Joseph Garvin wrote: > I'm curious -- what is everyone's favorite trick from a non-python > language? And -- why isn't it in Python? Duff's device is a classic masterpiece of lateral thinking. It is not possible in Python for many fundamental reasons, we are not at risk

Re: Multiple instances of a python program

2005-06-17 Thread gatti
Most of the Python interpreter is a shared library, at least on Windows. The only duplication is in loaded Python code, which includes only your bot and the libraries it uses. If you have memory problems, try to do without some libraries or to edit unused parts out of them. Lorenzo Gatti