PyDev 2.7.5 Released

2013-05-29 Thread Fabio Zadrozny
Hi All, PyDev 2.7.5 has been released Details on PyDev: http://pydev.org Details on its development: http://pydev.blogspot.com Release Highlights: --- * Icons in the outline are now correct. * Fixed deadlock found on code analysis. * Project-related error markers

[ANN] pypiserver 1.1.1 - minimal private pypi server

2013-05-29 Thread Ralf Schmitt
Hi, I've just uploaded pypiserver 1.1.1 to the python package index. pypiserver is a minimal PyPI compatible server. It can be used to serve a set of packages and eggs to easy_install or pip. pypiserver is easy to install (i.e. just 'pip install pypiserver'). It doesn't have any external

MacroPy Final Report, Request for Feedback

2013-05-29 Thread Haoyi Li
Hey All, I'd like to announce the release of MacroPy 0.1.7 (https://github.com/lihaoyi/macropy). MacroPy is an implementation of Syntactic Macros in the Python Programming Language, which we used to implement a pretty impressive list of demo macros: - Case Classes, easy Algebraic Data Types

Re: Python error codes and messages location

2013-05-29 Thread Fábio Santos
On 29 May 2013 00:44, Dennis Lee Bieber wlfr...@ix.netcom.com wrote: On Tue, 28 May 2013 17:15:51 +1000, Chris Angelico ros...@gmail.com declaimed the following in gmane.comp.python.general: Can we internationalize English instead of localizing Python? Not-entirely-joking-ly yours,

Re: Future standard GUI library

2013-05-29 Thread Chris Angelico
On Wed, May 29, 2013 at 3:26 AM, Wolfgang Keller felip...@gmx.net wrote: I won't give you an example, but just some very basic criteria: - It must be very efficient for very small datagrams - It must provide connections - For asynchronous programming it must provide for callbacks In other

Re: String object has no attribute append

2013-05-29 Thread Chris Angelico
On Wed, May 29, 2013 at 4:25 AM, Matt Graves tunacu...@gmail.com wrote: I receive this error while toying around with Functions... def pulldata(speclist,speccolumn): (speclist).append(column[('speccolumn')]) pulldata(speclist = 'numbers', speccolumn = 0) I'm getting the

Re: IndentationError: expected an indented block but it's there

2013-05-29 Thread Chris Angelico
On Wed, May 29, 2013 at 2:53 AM, Peter Otten __pete...@web.de wrote: Chris Angelico wrote: On Wed, May 29, 2013 at 2:19 AM, Peter Otten __pete...@web.de wrote: Solution: configure your editor to use four spaces for indentation. ITYM eight spaces. I meant: one hit of the Tab key should add

Re: Python for IPSA (Power flow analysis)

2013-05-29 Thread steve . ingram
On Tuesday, May 28, 2013 11:00:42 AM UTC+1, Debbie wrote: Hi there, I am new to Python, and wondering if you could help me with python based coding for the IPSA (Power system analysis software). I have a electrical distribution network with generators, buses and loads, on which I am

MySQL dymanic query in Python

2013-05-29 Thread RAHUL RAJ
Can anyone tell me the proper way in which I can execute dynamic MySQL queries in Python? I want to do dynamic queries for both CREATE and INSERT statement. Here is my attempted code: sql=create table %s (%%s, %%s, %%s ... ) % (tablename,''.join(fields)+' '.join(types)) cur.execute(sql)

Re: MySQL dymanic query in Python

2013-05-29 Thread Fábio Santos
On 29 May 2013 10:13, RAHUL RAJ omrahulraj...@gmail.com wrote: Can anyone tell me the proper way in which I can execute dynamic MySQL queries in Python? I want to do dynamic queries for both CREATE and INSERT statement. Here is my attempted code: sql=create table %s (%%s, %%s, %%s ... ) %

Re: Text-to-Sound or Vice Versa (Method NOT the source code)

2013-05-29 Thread rusi
On May 29, 4:30 am, Dennis Lee Bieber wlfr...@ix.netcom.com wrote: On Tue, 28 May 2013 15:10:03 + (UTC), Grant Edwards inva...@invalid.invalid declaimed the following in gmane.comp.python.general: On 2013-05-25, Rakshith Nayak rnyk1...@gmail.com wrote: Always wondered how sound is

Re: Encodign issue in Python 3.3.1 (once again)

2013-05-29 Thread nagia . retsina
What makes us o sure it is a pymysql issue and not python's encoding issue? -- http://mail.python.org/mailman/listinfo/python-list

Re: usage of os.posix_fadvise

2013-05-29 Thread Antoine Pitrou
Hi, Wolfgang Maier wolfgang.maier at biologie.uni-freiburg.de writes: Dear all, I was just experimenting for the first time with os.posix_fadvise(), which is new in Python3.3 . I'm reading from a really huge file (several GB) and I want to use the data only once, so I don't want OS-level

detect key conflict in a JSON file

2013-05-29 Thread Jabba Laci
Hi, How can you detect if a key is duplicated in a JSON file? Example: { something: [...], ... something: [...] } I have a growing JSON file that I edit manually and it might happen that I repeat a key. If this happens, I would like to get notified. Currently the value of the second

Output is not coming with defined color

2013-05-29 Thread Avnesh Shakya
hi, I am trying to display my output with different colour on terminal, but it's coming with that colour code. Please help me how is it possible? my code is - from fabric.colors import green, red, blue def colorr(): a = red('This is red') b = green('This is green') c = blue('This

Fatal Python error

2013-05-29 Thread Joshua Landau
Hello all, again. Instead of revising like I'm meant to be, I've been delving into a bit of Python and I've come up with this code: class ClassWithProperty: @property def property(self): pass thingwithproperty = ClassWithProperty() def loop(): try: thingwithproperty.property except: pass

Re: Output is not coming with defined color

2013-05-29 Thread Fábio Santos
On 29 May 2013 12:25, Avnesh Shakya avnesh.n...@gmail.com wrote: hi, I am trying to display my output with different colour on terminal, but it's coming with that colour code. Please help me how is it possible? my code is - from fabric.colors import green, red, blue def colorr():

Re: Fatal Python error

2013-05-29 Thread Dave Angel
On 05/29/2013 07:48 AM, Joshua Landau wrote: Hello all, again. Instead of revising like I'm meant to be, I've been delving into a bit of Python and I've come up with this code: To start with, please post in text mode. By using html, you've completely messed up any indentation you presumably

Re: Fatal Python error

2013-05-29 Thread Marcel Rodrigues
I just tried your code with similar results: it does nothing on PyPy 2.0.0-beta2 and Python 2.7.4. But on Python 3.3.1 it caused core dump. It's a little weird but so is the code. You have defined a function that calls itself unconditionally. This will cause a stack overflow, which is a

Re: Fatal Python error

2013-05-29 Thread Joshua Landau
On 29 May 2013 13:25, Dave Angel da...@davea.name wrote: On 05/29/2013 07:48 AM, Joshua Landau wrote: Hello all, again. Instead of revising like I'm meant to be, I've been delving into a bit of Python and I've come up with this code: To start with, please post in text mode. By using html,

Re: Fatal Python error

2013-05-29 Thread Oscar Benjamin
On 29 May 2013 12:48, Joshua Landau joshua.landau...@gmail.com wrote: Hello all, again. Instead of revising like I'm meant to be, I've been delving into a bit of Python and I've come up with this code: Here's a simpler example that gives similar results: $ py -3.3 Python 3.3.2

Re: Fatal Python error

2013-05-29 Thread Dave Angel
On 05/29/2013 08:45 AM, Oscar Benjamin wrote: On 29 May 2013 12:48, Joshua Landau joshua.landau...@gmail.com wrote: Hello all, again. Instead of revising like I'm meant to be, I've been delving into a bit of Python and I've come up with this code: Here's a simpler example that gives similar

Re: Fatal Python error

2013-05-29 Thread Joshua Landau
On 29 May 2013 13:30, Marcel Rodrigues marcel...@gmail.com wrote: I just tried your code with similar results: it does nothing on PyPy 2.0.0-beta2 and Python 2.7.4. But on Python 3.3.1 it caused core dump. It's a little weird but so is the code. You have defined a function that calls itself

Re: Fatal Python error

2013-05-29 Thread Marcel Rodrigues
I think the issue here has little to do with classes/objects/properties. See, for example, the code posted by Oscar Benjamin. What that code is trying to do is similar to responding to an Out Of Memory error with something that might require more memory allocation. Even if we consider the Py3

Re: detect key conflict in a JSON file

2013-05-29 Thread Roy Smith
In article mailman.2347.1369826248.3114.python-l...@python.org, Jabba Laci jabba.l...@gmail.com wrote: I have a growing JSON file that I edit manually and it might happen that I repeat a key. If this happens, I would like to get notified. The real answer here is that JSON is probably not the

Re: detect key conflict in a JSON file

2013-05-29 Thread Jabba Laci
The real answer here is that JSON is probably not the best choice for large files that get hand-edited. For data that you intend to hand-edit a lot, YAML might be a better choice. Currently the value of the second key silently overwrites the value of the first. Thanks but how would it be

Re: Fatal Python error

2013-05-29 Thread Joshua Landau
On 29 May 2013 14:02, Dave Angel da...@davea.name wrote: On 05/29/2013 08:45 AM, Oscar Benjamin wrote: Joshua: Avoid doing anything complex inside an exception handler. Unfortunately, Ranger (the file manager in question) wraps a lot of stuff in one big exception handler. Hence there isn't

Re: Output is not coming with defined color

2013-05-29 Thread rusi
On May 29, 5:11 pm, Fábio Santos fabiosantos...@gmail.com wrote: On 29 May 2013 12:25, Avnesh Shakya avnesh.n...@gmail.com wrote: hi,    I am trying to display my output with different colour on terminal, but it's coming with that colour code. Please help me how is it possible?

Re: detect key conflict in a JSON file

2013-05-29 Thread Ervin Hegedüs
Hello, On Wed, May 29, 2013 at 03:41:50PM +0200, Jabba Laci wrote: The real answer here is that JSON is probably not the best choice for large files that get hand-edited. For data that you intend to hand-edit a lot, YAML might be a better choice. Currently the value of the second key

Re: Short-circuit Logic

2013-05-29 Thread Ahmed Abdulshafy
On Tuesday, May 28, 2013 3:48:17 PM UTC+2, Steven D'Aprano wrote: On Mon, 27 May 2013 13:11:28 -0700, Ahmed Abdulshafy wrote: That may be true for integers, but for floats, testing for equality is not always precise Incorrect. Testing for equality is always precise, and exact.

Re: Short-circuit Logic

2013-05-29 Thread Chris Angelico
On Thu, May 30, 2013 at 12:27 AM, Ahmed Abdulshafy abdulsh...@gmail.com wrote: Well, this is taken from my python shell 0.33455857352426283 == 0.33455857352426282 True 0.33455857352426283,0.33455857352426282 (0.3345585735242628, 0.3345585735242628) They're not representably different.

Re: Short-circuit Logic

2013-05-29 Thread rusi
On May 29, 7:27 pm, Ahmed Abdulshafy abdulsh...@gmail.com wrote: On Tuesday, May 28, 2013 3:48:17 PM UTC+2, Steven D'Aprano wrote: On Mon, 27 May 2013 13:11:28 -0700, Ahmed Abdulshafy wrote: That may be true for integers, but for floats, testing for equality is not always precise

Re: detect key conflict in a JSON file

2013-05-29 Thread rusi
On May 29, 6:41 pm, Jabba Laci jabba.l...@gmail.com wrote: The real answer here is that JSON is probably not the best choice for large files that get hand-edited.  For data that you intend to hand-edit a lot, YAML might be a better choice. Currently the value of the second key silently

Re: Python #ifdef

2013-05-29 Thread Grant Edwards
On 2013-05-28, Carlos Nepomuceno carlosnepomuc...@outlook.com wrote: How do you have invalid@invalid.invalid instead of your email address? I have this in my .slrnrc: set hostname invalid.invalid set username grant set realname Grant Edwards I'm not sure why it doesn't show up as

Re: Fatal Python error

2013-05-29 Thread rusi
On May 29, 5:43 pm, Joshua Landau joshua.landau...@gmail.com wrote: On 29 May 2013 13:25, Dave Angel da...@davea.name wrote: On 05/29/2013 07:48 AM, Joshua Landau wrote: Hello all, again. Instead of revising like I'm meant to be, I've been delving into a bit of Python and I've come up

Re: Python #ifdef

2013-05-29 Thread Grant Edwards
On 2013-05-29, Dan Stromberg drsali...@gmail.com wrote: And in case you still want a preprocessor for Python (you likely don't need one this time), here's an example of doing this using the venerable m4: https://pypi.python.org/pypi/red-black-tree-mod . Note the many comments added to keep

Re: Python #ifdef

2013-05-29 Thread Chris Angelico
On Thu, May 30, 2013 at 12:55 AM, Grant Edwards invalid@invalid.invalid wrote: On 2013-05-29, Dan Stromberg drsali...@gmail.com wrote: And in case you still want a preprocessor for Python (you likely don't need one this time), here's an example of doing this using the venerable m4:

Re: Fatal Python error

2013-05-29 Thread Oscar Benjamin
On 29 May 2013 14:02, Dave Angel da...@davea.name wrote: On 05/29/2013 08:45 AM, Oscar Benjamin wrote: More likely a bug in the 2.x interpreter. Once inside an exception handler, that frame must be held somehow. If not on the stack, then in some separate list. So the logic will presumably

Re: detect key conflict in a JSON file

2013-05-29 Thread Roy Smith
On May 29, 2013, at 9:41 AM, Jabba Laci wrote: The real answer here is that JSON is probably not the best choice for large files that get hand-edited. For data that you intend to hand-edit a lot, YAML might be a better choice. Currently the value of the second key silently overwrites the

Re: Python #ifdef

2013-05-29 Thread Grant Edwards
On 2013-05-29, Chris Angelico ros...@gmail.com wrote: On Thu, May 30, 2013 at 12:55 AM, Grant Edwards invalid@invalid.invalid wrote: On 2013-05-29, Dan Stromberg drsali...@gmail.com wrote: And in case you still want a preprocessor for Python (you likely don't need one this time), here's an

Re: detect key conflict in a JSON file

2013-05-29 Thread Chris Rebert
On Wed, May 29, 2013 at 4:16 AM, Jabba Laci jabba.l...@gmail.com wrote: Hi, How can you detect if a key is duplicated in a JSON file? Example: { something: [...], ... something: [...] } I have a growing JSON file that I edit manually and it might happen that I repeat a key.

Re: Short-circuit Logic

2013-05-29 Thread Ian Kelly
On Wed, May 29, 2013 at 8:33 AM, rusi rustompm...@gmail.com wrote: 0.0 == 0.0 implies 5.4 == 5.4 is not a true statement is what (I think) Steven is saying. 0 (or if you prefer 0.0) is special and is treated specially. It has nothing to do with 0 being special. A floating point number will

Re: Piping processes works with 'shell = True' but not otherwise.

2013-05-29 Thread Chris Rebert
On Sun, May 26, 2013 at 4:58 PM, Luca Cerone luca.cer...@gmail.com wrote: snip Hi Chris, first of all thanks for the help. Unfortunately I can't provide the actual commands because are tools that are not publicly available. I think I get the tokenization right, though.. the problem is not that

Re: Piping processes works with 'shell = True' but not otherwise.

2013-05-29 Thread Thomas Rachel
Am 27.05.2013 02:14 schrieb Carlos Nepomuceno: pipes usually consumes disk storage at '/tmp'. Good that my pipes don't know about that. Why should that happen? Thomas -- http://mail.python.org/mailman/listinfo/python-list

Getting a callable for any value?

2013-05-29 Thread Croepha
Is there anything like this in the standard library? class AnyFactory(object): def __init__(self, anything): self.product = anything def __call__(self): return self.product def __repr__(self): return %s.%s(%r) % (self.__class__.__module__, self.__class__.__name__, self.product) my use case is:

Re: Getting a callable for any value?

2013-05-29 Thread andrea crotti
On 05/29/2013 06:46 PM, Croepha wrote: Is there anything like this in the standard library? class AnyFactory(object): def __init__(self, anything): self.product = anything def __call__(self): return self.product def __repr__(self): return %s.%s(%r) % (self.__class__.__module__,

Re: Getting a callable for any value?

2013-05-29 Thread Ned Batchelder
On 5/29/2013 1:46 PM, Croepha wrote: Is there anything like this in the standard library? class AnyFactory(object): def __init__(self, anything): self.product = anything def __call__(self): return self.product def __repr__(self): return %s.%s(%r) % (self.__class__.__module__,

Re: Getting a callable for any value?

2013-05-29 Thread Fábio Santos
On 29 May 2013 18:51, Croepha croe...@gmail.com wrote: Is there anything like this in the standard library? class AnyFactory(object): def __init__(self, anything): self.product = anything def __call__(self): return self.product def __repr__(self): return %s.%s(%r) %

Re: Getting a callable for any value?

2013-05-29 Thread Ian Kelly
On Wed, May 29, 2013 at 11:46 AM, Croepha croe...@gmail.com wrote: Is there anything like this in the standard library? class AnyFactory(object): def __init__(self, anything): self.product = anything def __call__(self): return self.product def __repr__(self): return %s.%s(%r) %

The state of pySerial

2013-05-29 Thread Ma Xiaojun
Hi, all. pySerial is probably the solution for serial port programming. Physical serial port is dead on PC but USB-to-Serial give it a second life. Serial port stuff won't interest end users at all. But it is still used in the EE world and so on. Arduino uses it to upload programs. Sensors may

Re: Getting a callable for any value?

2013-05-29 Thread Ian Kelly
On Wed, May 29, 2013 at 12:19 PM, Fábio Santos fabiosantos...@gmail.com wrote: Are you sure you don't want to use a lambda expression? They are pretty pythonic. none_factory = lambda: None defaultdict_none_factory = lambda: defaultdict(none_factory)

python b'...' notation

2013-05-29 Thread alcyon
This notation displays hex values except when they are 'printable', in which case it displays that printable character. How do I get it to force hex for all bytes? Thanks, Steve -- http://mail.python.org/mailman/listinfo/python-list

Re: How clean/elegant is Python's syntax?

2013-05-29 Thread Ma Xiaojun
A bit more context. If visiting z.cn (Amazon China), one can see that there are plenty of new (published in 2010 or later) books on QBASIC, Visual Basic, Visual Foxpro. This is weird, if one want to do development legally these tools won't be a option for new programmers. However, I also like

How clean/elegant is Python's syntax?

2013-05-29 Thread Ma Xiaojun
Hi, list. I hope this is not a duplicate of older question. If so, drop me a link is enough. I've used Python here and there, just for the sweet libraries though. For the core language, I have mixed feeling. On one hand, I find that Python has some sweet feature that is quite useful. On the

Re: How clean/elegant is Python's syntax?

2013-05-29 Thread Chris Angelico
On Thu, May 30, 2013 at 4:37 AM, Ma Xiaojun damage3...@gmail.com wrote: Yes, Python has much more libraries. But it seems that Python is more useful and suitable in CLI and Web applications. People are still discussing whether to replace tkinter with wxPython or not. VB and VFP people are

Re: python b'...' notation

2013-05-29 Thread Ian Kelly
On Wed, May 29, 2013 at 12:33 PM, alcyon st...@terrafirma.us wrote: This notation displays hex values except when they are 'printable', in which case it displays that printable character. How do I get it to force hex for all bytes? Thanks, Steve Is this what you want? ''.join('%02x' % x

RE: Piping processes works with 'shell = True' but not otherwise.

2013-05-29 Thread Carlos Nepomuceno
From: nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa...@spamschutz.glglgl.de Subject: Re: Piping processes works with 'shell = True' but not otherwise. Date: Wed, 29 May 2013 19:39:40 +0200 To: python-list@python.org Am 27.05.2013 02:14 schrieb Carlos

Re: The state of pySerial

2013-05-29 Thread Grant Edwards
On 2013-05-29, Ma Xiaojun damage3...@gmail.com wrote: pySerial is probably the solution for serial port programming. Physical serial port is dead on PC but USB-to-Serial give it a second life. Serial port stuff won't interest end users at all. But it is still used in the EE world and so on.

Re: The state of pySerial

2013-05-29 Thread William Ray Wing
On May 29, 2013, at 2:23 PM, Ma Xiaojun damage3...@gmail.com wrote: Hi, all. pySerial is probably the solution for serial port programming. Physical serial port is dead on PC but USB-to-Serial give it a second life. Serial port stuff won't interest end users at all. But it is still used in

Re: How clean/elegant is Python's syntax?

2013-05-29 Thread Walter Hurry
On Thu, 30 May 2013 04:54:44 +1000, Chris Angelico wrote: snip GUIs and databasing are two of the areas where I think Python's standard library could stand to be improved a bit. There are definitely some rough edges there. Dunno what you mean about standard library, but I'm very happy with

Re: How clean/elegant is Python's syntax?

2013-05-29 Thread Mark Janssen
You might try http://wiki.python.org/moin/BeginnersGuide -- MarkJ Tacoma, Washington -- http://mail.python.org/mailman/listinfo/python-list

Re: The state of pySerial

2013-05-29 Thread Terry Jan Reedy
On 5/29/2013 4:00 PM, William Ray Wing wrote: On May 29, 2013, at 2:23 PM, Ma Xiaojun damage3...@gmail.com wrote: Hi, all. pySerial is probably the solution for serial port programming. Physical serial port is dead on PC but USB-to-Serial give it a second life. Serial port stuff won't

Re: The state of pySerial

2013-05-29 Thread Terry Jan Reedy
On 5/29/2013 3:47 PM, Grant Edwards wrote: On 2013-05-29, Ma Xiaojun damage3...@gmail.com wrote: pySerial is probably the solution for serial port programming. Physical serial port is dead on PC but USB-to-Serial give it a second life. Serial port stuff won't interest end users at all. But it

Re: How clean/elegant is Python's syntax?

2013-05-29 Thread Cameron Simpson
On 30May2013 02:13, Ma Xiaojun damage3...@gmail.com wrote: | For the core language, I have mixed feeling. On one hand, I find that | Python has some sweet feature that is quite useful. On the other hand, | I often find Pyhton snippets around hard to understand. I think you will find that is lack

Re: python b'...' notation

2013-05-29 Thread Cameron Simpson
On 29May2013 13:14, Ian Kelly ian.g.ke...@gmail.com wrote: | On Wed, May 29, 2013 at 12:33 PM, alcyon st...@terrafirma.us wrote: | This notation displays hex values except when they are 'printable', in which case it displays that printable character. How do I get it to force hex for all bytes?

Re: The state of pySerial

2013-05-29 Thread MRAB
On 29/05/2013 22:38, Terry Jan Reedy wrote: On 5/29/2013 4:00 PM, William Ray Wing wrote: On May 29, 2013, at 2:23 PM, Ma Xiaojun damage3...@gmail.com wrote: Hi, all. pySerial is probably the solution for serial port programming. Physical serial port is dead on PC but USB-to-Serial give it a

Re: Piping processes works with 'shell = True' but not otherwise.

2013-05-29 Thread Cameron Simpson
On 29May2013 19:39, Thomas Rachel nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa...@spamschutz.glglgl.de wrote: | Am 27.05.2013 02:14 schrieb Carlos Nepomuceno: | pipes usually consumes disk storage at '/tmp'. | | Good that my pipes don't know about that. | Why should that happen? It probably

Re: Short-circuit Logic

2013-05-29 Thread Dave Angel
On 05/29/2013 12:50 PM, Ian Kelly wrote: On Wed, May 29, 2013 at 8:33 AM, rusi rustompm...@gmail.com wrote: 0.0 == 0.0 implies 5.4 == 5.4 is not a true statement is what (I think) Steven is saying. 0 (or if you prefer 0.0) is special and is treated specially. It has nothing to do with 0 being

Re: How clean/elegant is Python's syntax?

2013-05-29 Thread Dan Stromberg
On Wed, May 29, 2013 at 11:13 AM, Ma Xiaojun damage3...@gmail.com wrote: Hi, list. For the core language, I have mixed feeling. On one hand, I find that Python has some sweet feature that is quite useful. On the other hand, I often find Pyhton snippets around hard to understand. I admit that

Re: How clean/elegant is Python's syntax?

2013-05-29 Thread Ma Xiaojun
On Thu, May 30, 2013 at 8:24 AM, Dan Stromberg drsali...@gmail.com wrote: I'm finding it kind of hard to imagine not finding Python's syntax and semantics pretty graceful. About the only thing I don't like is: var = 1, That binds var to a tuple (singleton) value, instead of 1. Oh, and

Re: The state of pySerial

2013-05-29 Thread Ma Xiaojun
I've already mailed the author, waiting for reply. For Windows people, downloading a exe get you pySerial 2.5, which list_ports and miniterm feature seems not included. To use 2.6, download the tar.gz and use standard setup.py install to install it (assume you have .py associated) . There is no C

Re: Short-circuit Logic

2013-05-29 Thread Steven D'Aprano
On Wed, 29 May 2013 10:50:47 -0600, Ian Kelly wrote: On Wed, May 29, 2013 at 8:33 AM, rusi rustompm...@gmail.com wrote: 0.0 == 0.0 implies 5.4 == 5.4 is not a true statement is what (I think) Steven is saying. 0 (or if you prefer 0.0) is special and is treated specially. It has nothing to

Re: How clean/elegant is Python's syntax?

2013-05-29 Thread rusi
On May 30, 6:14 am, Ma Xiaojun damage3...@gmail.com wrote: What interest me is a one liner: print '\n'.join(['\t'.join(['%d*%d=%d' % (j,i,i*j) for i in range(1,10)]) for j in range(1,10)]) Ha,Ha! The join method is one of the (for me) ugly features of python. You can sweep it under the carpet

Re: detect key conflict in a JSON file

2013-05-29 Thread Steven D'Aprano
On Wed, 29 May 2013 11:20:59 -0400, Roy Smith wrote: How to process (read) YAML files in Python? Take a look at http://pyyaml.org/ Beware that pyaml suffers from the same issue as pickle, namely that it can execute arbitrary code when reading untrusted data. -- Steven --

Re: detect key conflict in a JSON file

2013-05-29 Thread Jerry Hill
On Wed, May 29, 2013 at 1:10 PM, Chris Rebert c...@rebertia.com wrote: On Wed, May 29, 2013 at 4:16 AM, Jabba Laci jabba.l...@gmail.com wrote: I have a growing JSON file that I edit manually and it might happen that I repeat a key. If this happens, I would like to get notified. Currently

Re: Short-circuit Logic

2013-05-29 Thread Chris Angelico
On Thu, May 30, 2013 at 12:28 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: * de facto exact equality testing, only slower and with the *illusion* of avoiding equality, e.g. abs(x-y) sys.float_info.epsilon is just a long and slow way of saying x == y when both numbers are

Re: How clean/elegant is Python's syntax?

2013-05-29 Thread Chris Angelico
On Thu, May 30, 2013 at 7:01 AM, Walter Hurry walterhu...@lavabit.com wrote: On Thu, 30 May 2013 04:54:44 +1000, Chris Angelico wrote: snip GUIs and databasing are two of the areas where I think Python's standard library could stand to be improved a bit. There are definitely some rough edges

Re: How clean/elegant is Python's syntax?

2013-05-29 Thread Chris Angelico
On Thu, May 30, 2013 at 10:24 AM, Dan Stromberg drsali...@gmail.com wrote: I'm finding it kind of hard to imagine not finding Python's syntax and semantics pretty graceful. About the only thing I don't like is: var = 1, That binds var to a tuple (singleton) value, instead of 1. I

Re: The state of pySerial

2013-05-29 Thread Grant Edwards
On 2013-05-29, Terry Jan Reedy tjre...@udel.edu wrote: On 5/29/2013 3:47 PM, Grant Edwards wrote: On 2013-05-29, Ma Xiaojun damage3...@gmail.com wrote: [...] Unforunately, pySerial project doesn't seem to have a good state. I find pySerial + Python 3.3 broken on my machine (Python 2.7 is OK) .

Building a HPC data assimilation system using Python?

2013-05-29 Thread Matthew Francis
I have a prototype data assimilation code ( an ionospheric nowcast/forecast model driven by GPS data ) that is written in IDL (interactive data language) which is a horrible language choice for scaling the application up to large datasets as IDL is serial and slow (interpreted). I am embarking

Re: Short-circuit Logic

2013-05-29 Thread Steven D'Aprano
On Wed, 29 May 2013 07:27:40 -0700, Ahmed Abdulshafy wrote: On Tuesday, May 28, 2013 3:48:17 PM UTC+2, Steven D'Aprano wrote: On Mon, 27 May 2013 13:11:28 -0700, Ahmed Abdulshafy wrote: That may be true for integers, but for floats, testing for equality is not always precise

Re: Short-circuit Logic

2013-05-29 Thread Chris Angelico
On Thu, May 30, 2013 at 3:10 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: # Wrong, don't do this! x = 0.1 while x != 17.3: print(x) x += 0.1 Actually, I wouldn't do that with integers either. There are too many ways that a subsequent edit could get it wrong and go

Re: Short-circuit Logic

2013-05-29 Thread Steven D'Aprano
On Wed, 29 May 2013 20:23:00 -0400, Dave Angel wrote: Even in a pure decimal system of (say) 40 digits, I could type in a 42 digit number and it would get quantized. So just because two 42 digit numbers are different doesn't imply that the 40 digit internal format would be. Correct, and we

Re: Short-circuit Logic

2013-05-29 Thread Steven D'Aprano
On Thu, 30 May 2013 13:45:13 +1000, Chris Angelico wrote: Let's suppose someone is told to compare floating point numbers by seeing if the absolute value of the difference is less than some epsilon. Which is usually the wrong way to do it! Normally one would prefer *relative* error, not

[issue18047] Descriptors get invoked in old-style objects and classes

2013-05-29 Thread Raymond Hettinger
Raymond Hettinger added the comment: We document what we're willing to guarantee. The exposure of descriptors in old-style classes was an incidental implementation detail. Sorry, I'm going to close this one. Besides, it's time to start forgetting Python 2 and move along :-) --

[issue18092] Python 2.7.5 installation broken on OpenSuse 12.2

2013-05-29 Thread Andreas Jung
Changes by Andreas Jung zopyxfil...@gmail.com: -- components: +Build ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18092 ___ ___ Python-bugs-list

[issue18092] Python 2.7.5 installation broken on OpenSuse 12.2

2013-05-29 Thread Andreas Jung
New submission from Andreas Jung: I tried to install 2.7.5 on my OpenSuse 12.2 (latest patches) ajung@blackmoon2:~/sandboxes/mib.portal cat /etc/issue Welcome to openSUSE 12.2 Mantis - Kernel \r (\l). Compilation went fine (no visible errors). Starting the interpreter gives me:

[issue18092] Python 2.7.5 installation broken on OpenSuse 12.2

2013-05-29 Thread Ned Deily
Ned Deily added the comment: Without more information, it is difficult to guess what is going wrong. Please provide exactly what ./configure options you used to build Python and any make install options. When you start Python, what values do sys.prefix, sys.exec_prefix, and sys.path have?

[issue18052] IDLE 3.3.2 Windows taskbar icon regression

2013-05-29 Thread Martin v . Löwis
Martin v. Löwis added the comment: I can't reproduce the issue it all; IDLE just readily pins to the task bar with the correct icon. Can somebody please provide exact steps to reproduce? -- ___ Python tracker rep...@bugs.python.org

[issue18087] os.listdir don't show hidden option

2013-05-29 Thread Dražen Lučanin
Dražen Lučanin added the comment: I created a first version of the patch (attached as a remote hg repo). It would enable users to exclude hidden files with: import os print(os.listdir(path='.', show_hidden=False)) while still keeping full backwards compatibility, since show_hidden is

[issue11229] Make the Mac installer more like the Windows installer

2013-05-29 Thread Ronald Oussoren
Ronald Oussoren added the comment: I'm +1 on the general idea, but have some remarks anyway: 1) for all users vs. current user This likely requires a post-install script to fix up the load command's in binaries: on OSX binaries contain absolute paths to the libraries the link with (which for

[issue11229] Make the Mac installer more like the Windows installer

2013-05-29 Thread Ronald Oussoren
Ronald Oussoren added the comment: BTW. There is a completely different way for distributing Python: drop the entire installer and provide a zipfile containing a single application bundle. The most likely target for the application is IDLE, with a new menu item for making the command-line

[issue18052] IDLE 3.3.2 Windows taskbar icon regression

2013-05-29 Thread Terry J. Reedy
Terry J. Reedy added the comment: All I did was install (standard, all users) and start Idle without rebooting. Problem goes away after reboot. This happened on previous versions with different hardware. -- ___ Python tracker rep...@bugs.python.org

[issue18087] os.listdir don't show hidden option

2013-05-29 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: The concept of hidden file depends on the platform, and is independent of the listdir() function. The first thing is to agree on an implementation of the hidden property, and expose it as os.path.ishidden. Then we can consider an option to os.listdir.

[issue18087] os.listdir don't show hidden option

2013-05-29 Thread Antoine Pitrou
Antoine Pitrou added the comment: I don't really understand, since this is an easy one-liner: [n for n in os.listdir(...) if not n.startswith(.)] Also, as mentioned, what you want to hide is not necessarily well-defined. For example, under Unix you might want to hide *~ files. So I don't

[issue16102] uuid._netbios_getnode() is outdated

2013-05-29 Thread Antoine Pitrou
Antoine Pitrou added the comment: If noone has reported the issue in years (Google doesn't seem to report any occurrence), perhaps it means the code is simply not used anymore? In which case it should probably be removed. -- nosy: +pitrou ___

[issue9369] const char* for PyObject_CallMethod and PyObject_CallFunction

2013-05-29 Thread Antoine Pitrou
Antoine Pitrou added the comment: Looks good to me. -- nosy: +pitrou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9369 ___ ___ Python-bugs-list

[issue18087] os.listdir don't show hidden option

2013-05-29 Thread Dmi Baranov
Dmi Baranov added the comment: Also, as mentioned, what you want to hide is not necessarily well-defined. For example, under Unix you might want to hide *~ files. Yes, and instead of adding another parameters, something like that: os.listdir(path, show_hidden=False, hidden_files_mask='*~',

[issue17987] test.support.captured_stderr, captured_stdin not documented

2013-05-29 Thread Dmi Baranov
Dmi Baranov added the comment: Fred or Serhiy - any news here? I'm signed Contributor Agreement few days ago, just waiting a change in my profile here, please don't worry about copyright :-) -- ___ Python tracker rep...@bugs.python.org

[issue18090] dict_contains first argument declared register, and shouldn't be

2013-05-29 Thread Larry Hastings
Changes by Larry Hastings la...@hastings.org: -- nosy: +Mark.Shannon, rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18090 ___ ___

  1   2   >