Re: [OT] fortran lib which provide python like data type

2015-01-29 Thread Christian Gollwitzer
Am 30.01.15 um 02:40 schrieb Rustom Mody: > FORTRAN > > use dictionary > type(dictionary), pointer :: d > d=>dict_new() > call set(d//'toto',1) > v = d//'toto' > call dict_free(d) > > The corresponding python > > d = dict() > d['toto'] = 1 > v = d['toto'] > del(d) > > In particular no

Re: The Most Diabolical Python Antipattern

2015-01-29 Thread jtan
I would usually just log the stack trace so that I would still know that something bad happened while the app looks okay. On Fri, Jan 30, 2015 at 1:17 AM, Mark Lawrence wrote: > The author is quite clear on his views here https://realpython.com/blog/ > python/the-most-diabolical-python-antipatte

Re: The Most Diabolical Python Antipattern

2015-01-29 Thread Michiel Overtoom
On Jan 29, 2015, at 18:36, Skip Montanaro wrote: > There are the occasional instance where I need to recover > from an exception no matter what caused it. I had the same need, a while ago, when working on a CherryPy webapp which uses a BackgroundTask to parse user-uploaded data and image files

Re: The Most Diabolical Python Antipattern

2015-01-29 Thread Marko Rauhamaa
Ian Kelly : > At least use "except Exception" instead of a bare except. Do you > really want things like SystemExit and KeyboardInterrupt to get turned > into 0? How about: == try: do_interesting_stuff() except ValueError: try: log_

Re: Sort of Augmented Reality

2015-01-29 Thread Rustom Mody
On Friday, January 30, 2015 at 7:52:58 AM UTC+5:30, Dennis Lee Bieber wrote: > On Thu, 29 Jan 2015 14:38:20 +0100, franssoa > declaimed the following: > > >Hello, > > > >(please excuse my english as is not my primary language) > > > >- I own a webcam that take a picture of outside of my house once

Re: Python is DOOMED! Again!

2015-01-29 Thread MRAB
On 2015-01-29 23:25, Chris Kaynor wrote: On Thu, Jan 29, 2015 at 2:57 PM, BartC wrote: [snip] Putting in hints, (as as I implemented them using primitive types), meant that functions and code no longer worked in a generic (or polymorphic) manner. Code also changes, but the type hints aren't ma

Re: [OT] fortran lib which provide python like data type

2015-01-29 Thread Rustom Mody
On Friday, January 30, 2015 at 4:09:19 AM UTC+5:30, beli...@aol.com wrote: > On Thursday, January 29, 2015 at 10:01:00 AM UTC-5, Liu Zhenhai wrote: > > Hi, > > I am not sure here is the right place to ask this question, but I want to > > give it a shot:) > > are there fortran libs providing python

Installling ADODB on an offline computer

2015-01-29 Thread Alan Meyer
I work on an application that uses the ActivePython compilation of Python from ActiveState. It uses three Microsoft COM libraries that are needed for talking to SQL Server. The libraries are: Microsoft Activex Data Objects Microsoft Activex Data Objects Recordset Microsoft ADO Ext

Re: parsing tree from excel sheet

2015-01-29 Thread Chris Angelico
On Fri, Jan 30, 2015 at 8:32 AM, alb wrote: > Ok, that either means I need to upgrade to 3.3 or need to modify the > snippet to a suitable syntax that would work with other versions. You could replace "yield from child.show2()" with: for val in child.show2(): yield val and it should work. Howev

Re: Python is DOOMED! Again!

2015-01-29 Thread Chris Kaynor
On Thu, Jan 29, 2015 at 2:57 PM, BartC wrote: > I've read most of the thread but haven't been able to figure out /why/ this > is being proposed. What is the advantage, speed? Check out the rationale part of the PEP: https://www.python.org/dev/peps/pep-0484/#rationale-and-goals. Other parts of the

Re: The Most Diabolical Python Antipattern

2015-01-29 Thread Chris Angelico
On Fri, Jan 30, 2015 at 4:32 AM, Tim Chase wrote: > I have one that I call int0() > that is my "give me a freakin' int" function which is something like > > def int0(val): > try: > return int(val) > except: > return 0 > > because I deal with a lot of CSV data from client/vend

Re: Python is DOOMED! Again!

2015-01-29 Thread Chris Angelico
On Fri, Jan 30, 2015 at 9:57 AM, BartC wrote: > I've read most of the thread but haven't been able to figure out /why/ this > is being proposed. What is the advantage, speed? Have a read of the PEP: https://www.python.org/dev/peps/pep-0484/ ChrisA -- https://mail.python.org/mailman/listinfo/py

Re: Python is DOOMED! Again!

2015-01-29 Thread BartC
On 22/01/2015 04:30, Steven D'Aprano wrote: https://www.python.org/dev/peps/pep-0484/ Here's a potential real-world example, from the statistics module in Python 3.4, before and after adding annotations: def median_grouped(data, interval=1): ... def median_grouped(data:Iterable[Real], inter

Re: The Most Diabolical Python Antipattern

2015-01-29 Thread Ian Kelly
On Thu, Jan 29, 2015 at 10:32 AM, Tim Chase wrote: > On 2015-01-29 17:17, Mark Lawrence wrote: >> The author is quite clear on his views here >> https://realpython.com/blog/python/the-most-diabolical-python-antipattern/ >> but what do you guys and gals think? > > I just read that earlier today and

Re: [OT] fortran lib which provide python like data type

2015-01-29 Thread beliavsky
On Thursday, January 29, 2015 at 10:01:00 AM UTC-5, Liu Zhenhai wrote: > Hi, > I am not sure here is the right place to ask this question, but I want to > give it a shot:) > are there fortran libs providing python like data type, such as set, dict, > list? > Thanks, > Yours liuzhenhai The "Fortr

Re: The Most Diabolical Python Antipattern

2015-01-29 Thread Tim Chase
On 2015-01-29 17:17, Mark Lawrence wrote: > The author is quite clear on his views here > https://realpython.com/blog/python/the-most-diabolical-python-antipattern/ > but what do you guys and gals think? I just read that earlier today and agree for the most part. The only exception (pun only pa

Re: parsing tree from excel sheet

2015-01-29 Thread Chris Kaynor
On Thu, Jan 29, 2015 at 1:59 PM, Mark Lawrence wrote: > On 29/01/2015 21:32, alb wrote: >> >> Hi MRAB, >> >> MRAB wrote: >> [] > > SyntaxError: invalid syntax > debian@debian:example$ python3 export_latex.py doctree.csv >File "export_latex.py", line 36 > yield from ch

Re: An object is an instance (or not)?

2015-01-29 Thread Rick Johnson
On Wednesday, January 28, 2015 at 4:01:41 AM UTC-6, Chris Angelico wrote: > On Wed, Jan 28, 2015 at 8:16 PM, Steven D'Aprano wrote: > > Or perhaps that should be a sad face smiley :-( How much > > time we would all save if academics and language > > designers would only stick to a single consistent

Re: parsing tree from excel sheet

2015-01-29 Thread Mark Lawrence
On 29/01/2015 21:32, alb wrote: Hi MRAB, MRAB wrote: [] SyntaxError: invalid syntax debian@debian:example$ python3 export_latex.py doctree.csv File "export_latex.py", line 36 yield from child.show2() ^ SyntaxError: invalid syntax and I've tried with both python and pyth

Re: parsing tree from excel sheet

2015-01-29 Thread alb
Hi MRAB, MRAB wrote: [] >>> SyntaxError: invalid syntax >>> debian@debian:example$ python3 export_latex.py doctree.csv >>> File "export_latex.py", line 36 >>> yield from child.show2() >>> ^ >>> SyntaxError: invalid syntax >> >> and I've tried with both python and python3 (see b

Re: parsing tree from excel sheet

2015-01-29 Thread alb
Hi Tim, Tim Chase wrote: [] >> I know about the xlrd module to get data from excel > > If I have to get my code to read Excel files, xlrd is usually my > first and only stop. > It provides quite a good interface to manipulating excel files and I find it pretty easy even for my entry level! >

Re: parsing tree from excel sheet

2015-01-29 Thread MRAB
On 2015-01-29 21:02, alb wrote: Hi Peter, Peter Otten <__pete...@web.de> wrote: [] def show2(self): yield str(self) for child in self.children: yield from child.show2() here is what I get: SyntaxError: invalid syntax debian@debian:example$ python3 export_latex.py

Re: Python is DOOMED! Again!

2015-01-29 Thread Rick Johnson
On Thursday, January 29, 2015 at 10:11:56 AM UTC-6, Steven D'Aprano wrote: > > But what are type declarations in statically typed > languages like C, Pascal, Haskell, etc.? They are used by > the compiler for static analysis. The same applies to type > declarations in dynamically typed languages li

Re: Fwd: Re: Comparisons and sorting of a numeric class....

2015-01-29 Thread Andrew Robinson
On 01/27/2015 02:04 AM, Gregory Ewing wrote: Andrew Robinson wrote: The spelling caveat is great -- and in Python the object named in bool's honor is spelled bool (lowercase too). ;) That doesn't change the fact that the man was called George Boole (not Charles!). If you're going to refer to

Re: parsing tree from excel sheet

2015-01-29 Thread alb
Hi Peter, Peter Otten <__pete...@web.de> wrote: [] >def show2(self): >yield str(self) >for child in self.children: >yield from child.show2() here is what I get: > SyntaxError: invalid syntax > debian@debian:example$ python3 export_latex.py doctree.csv > File "e

Re: why zip64_limit defined as 1<<31 -1?

2015-01-29 Thread Ian Kelly
On Thu, Jan 29, 2015 at 12:12 PM, jesse wrote: > > On Jan 29, 2015 9:27 AM, "Ian Kelly" wrote: >> >> On Wed, Jan 28, 2015 at 2:36 PM, Chris Angelico wrote: >> > On Thu, Jan 29, 2015 at 5:53 AM, jesse wrote: >> >> should not it be 1<<32 -1(4g)? >> >> >> >> normal zip archive format should be abl

Re: why zip64_limit defined as 1<<31 -1?

2015-01-29 Thread jesse
On Jan 29, 2015 9:27 AM, "Ian Kelly" wrote: > > On Wed, Jan 28, 2015 at 2:36 PM, Chris Angelico wrote: > > On Thu, Jan 29, 2015 at 5:53 AM, jesse wrote: > >> should not it be 1<<32 -1(4g)? > >> > >> normal zip archive format should be able to support 4g file. > >> > >> thanks > > > > 1<<31-1 is

Re: joke

2015-01-29 Thread Ethan Furman
On 01/29/2015 10:58 AM, sohcahto...@gmail.com wrote: > On Thursday, January 29, 2015 at 10:30:46 AM UTC-8, Automn wrote: >> What about : >> >> - "The royal Python is Clean your highness." >> - "Thank you." > > I don't get it. I suspect it is a reference to an old Eddie Murphy (?) movie in which

Re: joke

2015-01-29 Thread sohcahtoa82
On Thursday, January 29, 2015 at 10:30:46 AM UTC-8, Automn wrote: > What about : > > - "The royal Python is Clean your highness." > - "Thank you." I don't get it. -- https://mail.python.org/mailman/listinfo/python-list

Re: Python is DOOMED! Again!

2015-01-29 Thread Mark Lawrence
On 29/01/2015 18:23, random...@fastmail.us wrote: Statically typed lanugages by definition can never give you a TypeError - there are no runtime conversions that can succeed or fail based on the type of the arguments. What makes a statically typed language strong or weak? Are statically typed la

joke

2015-01-29 Thread Automn
What about : - "The royal Python is Clean your highness." - "Thank you." -- https://mail.python.org/mailman/listinfo/python-list

Re: Python is DOOMED! Again!

2015-01-29 Thread random832
On Thu, Jan 29, 2015, at 10:56, Steven D'Aprano wrote: > Bar language, on the other hand, tries extremely hard to ensure that > every > type is automatically able to be coerced into every other type. The > coercion might not do what you expect, but it will do *something*: See, this is where the co

Re: The Most Diabolical Python Antipattern

2015-01-29 Thread Ethan Furman
On 01/29/2015 09:36 AM, Skip Montanaro wrote: > On Thu, Jan 29, 2015 at 11:17 AM, Mark Lawrence > wrote: >> >> ... but what do you guys and gals think? > > I saw that blog referenced elsewhere a day or two ago. I think he's > correct. There are the occasional instance where I need to recover > f

Results of the python 2.x and 3.x use survey, 2014 edition

2015-01-29 Thread Bruno Cauet
Hi! Finally, here are the results: http://blog.frite-camembert.net/python-survey-2014.html Here is the auto-generated Google Forms recap: https://docs.google.com/forms/d/1DqxkNi4GvyTCu54usSdE1DjW29zw1tc52iMeH3z4heg/viewanalytics (more elegant than my matplotlib graphs - I'd have no future as a desi

3d printing slicer

2015-01-29 Thread 3D artist
Hi everyone I'm trying to run Nick Parker's 3d printing slicer. https://github.com/nick-parker/python3Dplay/tree/master/Shift%20Method I am using WinPython 2.7.9.1 to import scipy https://winpython.github.io/ I get these errors when running main.py Traceback (most recent call last): File "C

Re: The Most Diabolical Python Antipattern

2015-01-29 Thread Skip Montanaro
On Thu, Jan 29, 2015 at 11:17 AM, Mark Lawrence wrote: > > ... but what do you guys and gals think? I saw that blog referenced elsewhere a day or two ago. I think he's correct. There are the occasional instance where I need to recover from an exception no matter what caused it. In cases where I f

Re: why zip64_limit defined as 1<<31 -1?

2015-01-29 Thread Ian Kelly
On Wed, Jan 28, 2015 at 2:36 PM, Chris Angelico wrote: > On Thu, Jan 29, 2015 at 5:53 AM, jesse wrote: >> should not it be 1<<32 -1(4g)? >> >> normal zip archive format should be able to support 4g file. >> >> thanks > > 1<<31-1 is the limit for a signed 32-bit integer. You'd have to look > into

The Most Diabolical Python Antipattern

2015-01-29 Thread Mark Lawrence
The author is quite clear on his views here https://realpython.com/blog/python/the-most-diabolical-python-antipattern/ but what do you guys and gals think? -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.p

Re: why zip64_limit defined as 1<<31 -1?

2015-01-29 Thread Ian Kelly
On Wed, Jan 28, 2015 at 5:55 PM, jesse wrote: > the official zip format spec states clearly that normal zip file should be > <= 4G size instead 2G. I just can not believe Python has such an obvious > bug. > > People suggested monkey patch the ZIP64_LIMIT value to pass 2G, I am not > sure what wil

ANN: Wing IDE 5.1 released

2015-01-29 Thread Wingware
Hi, Wingware has released version 5.1 of Wing IDE, our cross-platform integrated development environment for the Python programming language. Wing IDE features a professional code editor with vi, emacs, visual studio, and other key bindings, auto-completion, call tips, context-sensitive auto

Re: Python is DOOMED! Again!

2015-01-29 Thread Steven D'Aprano
Mario Figueiredo wrote: > In article <54c980cd$0$12981$c3e8da3$54964...@news.astraweb.com>, > steve+comp.lang.pyt...@pearwood.info says... >> >> Ian, that's obvious. Just open your eyes: >> >> Scala >> def addInt( a:Int, b:Int ) : Int >> >> Python >> def addInt( a:int, b:int ) -> int: >> >> >

Re: Python is DOOMED! Again!

2015-01-29 Thread Ian Kelly
On Thu, Jan 29, 2015 at 1:34 AM, Mario Figueiredo wrote: > In article <54c980cd$0$12981$c3e8da3$54964...@news.astraweb.com>, > steve+comp.lang.pyt...@pearwood.info says... >> >> Ian, that's obvious. Just open your eyes: >> >> Scala >> def addInt( a:Int, b:Int ) : Int >> >> Python >> def addInt( a:

Re: Python is DOOMED! Again!

2015-01-29 Thread Steven D'Aprano
Mario Figueiredo wrote: > In article , > breamore...@yahoo.co.uk says... >> >> C and C++ are weakly and statically typed languages. Python is a >> strongly and dynamically typed language. Therefore anything following >> based on the above paragraph alone is wrong. >> > > Indeed. I confused st

Re: Python is DOOMED! Again!

2015-01-29 Thread Steven D'Aprano
random...@fastmail.us wrote: > On Wed, Jan 28, 2015, at 13:16, Mark Lawrence wrote: >> C and C++ are weakly and statically typed languages. > > "strong typing" has no meaning at all, and "weak typing" means "anything > I don't like". I see you've been reading Chris Smith's essay on typing :-) h

Re: An object is an instance (or not)?

2015-01-29 Thread Ian Kelly
On Thu, Jan 29, 2015 at 12:16 AM, Steven D'Aprano wrote: > Besides, descriptors are > handled by the metaclass, so we could write a metaclass that doesn't handle > them. Maybe this doesn't affect your argument, but they're actually handled by the class's __getattribute__, not by the metaclass. >

[OT] fortran lib which provide python like data type

2015-01-29 Thread 1989lzhh
Hi, I am not sure here is the right place to ask this question, but I want to give it a shot:) are there fortran libs providing python like data type, such as set, dict, list? Thanks, Yours liuzhenhai -- https://mail.python.org/mailman/listinfo/python-list

Отв: Python on armv7l router: C++ exceptions issue

2015-01-29 Thread Alex Potapenko
Found a solution myself. It looks like you have to explicitly link python with libgcc_s during build time to solve this problem. This looks like a uClibc bug Regards,Alex среда, 28 января 2015 19:44 Alex Potapenko писал(а): I run Python on an arm-brcm-linux-uclibcgnueabi router. Pyt

Re: Python is DOOMED! Again!

2015-01-29 Thread random832
On Wed, Jan 28, 2015, at 13:16, Mark Lawrence wrote: > C and C++ are weakly and statically typed languages. "strong typing" has no meaning at all, and "weak typing" means "anything I don't like". The fact that you can add an int and a float, or that you can use any object as a boolean, would make

Sort of Augmented Reality

2015-01-29 Thread franssoa
Hello, (please excuse my english as is not my primary language) - I own a webcam that take a picture of outside of my house once per minute. - With a DVB sticker, I know the latitude, longitude and altitude of the planes in my area. I would like to print the data of the planes visibles on the p

Re: ANN: unpyc3 - a python bytecode decompiler for Python3

2015-01-29 Thread Devin Jeanpierre
On Wed, Jan 28, 2015 at 4:34 PM, Steven D'Aprano wrote: > Devin Jeanpierre wrote: >> Git doesn't help if you lose your files in between commits, > > Sure it does? You just lose the changes made since the previous commit, but > that's no different from restoring from backup. The restored file is on

Re: ANN: unpyc3 - a python bytecode decompiler for Python3

2015-01-29 Thread Cem Karan
On Jan 28, 2015, at 5:02 PM, Chris Angelico wrote: > On Thu, Jan 29, 2015 at 8:52 AM, Devin Jeanpierre > wrote: >> Git doesn't help if you lose your files in between commits, or if you >> lose the entire directory between pushes. > > So you commit often and push immediately. Solved. > > Chris

Re: Python is DOOMED! Again!

2015-01-29 Thread Mark Lawrence
On 29/01/2015 08:23, Mario Figueiredo wrote: In article , breamore...@yahoo.co.uk says... C and C++ are weakly and statically typed languages. Python is a strongly and dynamically typed language. Therefore anything following based on the above paragraph alone is wrong. Indeed. I confused s

ANN: Python Meeting Düsseldorf - New Videos online

2015-01-29 Thread eGenix Team: M.-A. Lemburg
[This announcement is in German since it targets a local user group meeting in Düsseldorf, Germany] WAS IST DAS PYTHON MEETING DÜSSELDORF ? Das Python Meeting Düsseldorf ist eine Veranstaltung, die alle drei Monate in Düss

Re: Python is DOOMED! Again!

2015-01-29 Thread Mario Figueiredo
In article <54c980cd$0$12981$c3e8da3$54964...@news.astraweb.com>, steve+comp.lang.pyt...@pearwood.info says... > > Ian, that's obvious. Just open your eyes: > > Scala > def addInt( a:Int, b:Int ) : Int > > Python > def addInt( a:int, b:int ) -> int: > > > They're COMPLETELY different. In Scal

Re: why zip64_limit defined as 1<<31 -1?

2015-01-29 Thread Mark Lawrence
On 29/01/2015 00:55, jesse wrote: the official zip format spec states clearly that normal zip file should be <= 4G size instead 2G. I just can not believe Python has such an obvious bug. People suggested monkey patch the ZIP64_LIMIT value to pass 2G, I am not sure what will be the ramifications

Re: Python is DOOMED! Again!

2015-01-29 Thread Mario Figueiredo
In article , breamore...@yahoo.co.uk says... > > C and C++ are weakly and statically typed languages. Python is a > strongly and dynamically typed language. Therefore anything following > based on the above paragraph alone is wrong. > Indeed. I confused strongly/weakly with static. I feel a

Re: why zip64_limit defined as 1<<31 -1?

2015-01-29 Thread jesse
the official zip format spec states clearly that normal zip file should be <= 4G size instead 2G. I just can not believe Python has such an obvious bug. People suggested monkey patch the ZIP64_LIMIT value to pass 2G, I am not sure what will be the ramifications. On Jan 28, 2015 1:37 PM, "Chris An

Re: multiprocessing module backport from 3 to 2.7 - spawn feature

2015-01-29 Thread Andres Riancho
On Wed, Jan 28, 2015 at 3:06 PM, Skip Montanaro wrote: > > On Wed, Jan 28, 2015 at 7:07 AM, Andres Riancho > wrote: >> >> The feature I'm specially interested in is the ability to spawn >> processes [1] instead of forking, which is not present in the 2.7 >> version of the module. > > > Can you ex