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

2015-01-31 Thread Marko Rauhamaa
Rustom Mody : > There is a real conflict between the logician's goal and the > educator's. The logician wants to minimize the variety of ideas, > and doesn't mind a long, thin path. The educator (rightly) wants > to make the paths short and doesn't mind–in fact, > prefers–connections to many other

Re: CSV and number formats

2015-01-31 Thread Mark Lawrence
On 01/02/2015 06:45, Frank Millman wrote: Hi all I downloaded some bank statements in CSV format with a view to providing an automated bank reconciliation feature for my accounting software. One of them shows the opening balance in an unusual format. Most transaction amounts are in the format

Re: Python is DOOMED! Again!

2015-01-31 Thread Devin Jeanpierre
Sorry, sort of responding to both of you. On Sat, Jan 31, 2015 at 10:12 PM, Paul Rubin wrote: > Steven D'Aprano writes: >> Some degree of weakness in a type system is not necessarily bad. Even the >> strongest of languages usually allow a few exceptions, such as numeric >> coercions. > > Haskell

CSV and number formats

2015-01-31 Thread Frank Millman
Hi all I downloaded some bank statements in CSV format with a view to providing an automated bank reconciliation feature for my accounting software. One of them shows the opening balance in an unusual format. Most transaction amounts are in the format '-0031.23' or '+0024.58' This can

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

2015-01-31 Thread Paul Rubin
Marko Rauhamaa writes: > The guiding principle in C++ language development is to take static > type safety to the extreme. Heh, try Ada. > Stroustrup apparently has never had to deal with callbacks; his thick > books never made a mention of them last time I checked. C++ has function pointers

Re: Python is DOOMED! Again!

2015-01-31 Thread Paul Rubin
Steven D'Aprano writes: > Some degree of weakness in a type system is not necessarily bad. Even the > strongest of languages usually allow a few exceptions, such as numeric > coercions. Haskell doesn't have automatic coercions of any sort. You have to call a conversion function if you want to tu

dunder-docs (was Python is DOOMED! Again!)

2015-01-31 Thread Rustom Mody
On Sunday, February 1, 2015 at 10:15:13 AM UTC+5:30, Ethan Furman wrote: > On 01/31/2015 07:16 PM, Steven D'Aprano wrote: > > > > But by default, Python will fallback on __repr__ if __str__ doesn't exist, > > or __str__ if __repr__ doesn't exist, or both. Or something. (I always > > forget what th

Re: Python is DOOMED! Again!

2015-01-31 Thread Ethan Furman
On 01/31/2015 07:16 PM, Steven D'Aprano wrote: > > But by default, Python will fallback on __repr__ if __str__ doesn't exist, > or __str__ if __repr__ doesn't exist, or both. Or something. (I always > forget what the rules are exactly.) If __str__ is missing, __repr__ is called. If __repr__ is m

Re: Python is DOOMED! Again!

2015-01-31 Thread Chris Angelico
On Sun, Feb 1, 2015 at 2:16 PM, Steven D'Aprano wrote: > Chris Angelico wrote: > >> On Sat, Jan 31, 2015 at 10:56 PM, Steven D'Aprano >> wrote: >>> Both ints and floats are models of the same abstract thing, namely >>> "number". Ideally, from a mathematically standpoint, there should be no >>> di

Re: RAII vs gc (was fortran lib which provide python like data type)

2015-01-31 Thread Devin Jeanpierre
On Fri, Jan 30, 2015 at 1:28 PM, Sturla Molden wrote: > in Python. It actually corresponds to > > with Foo() as bar: > The problem with with statements is that they only handle the case of RAII with stack allocated variables, and can't handle transfer of ownership cleanly. Consider the case

Re: Create dictionary based of x items per key from two lists

2015-01-31 Thread Chris Angelico
On Sun, Feb 1, 2015 at 2:06 PM, Mark Lawrence wrote: > The one-liner might not be better code, but it must be better speed wise > precisely because it's on one line, right? :) Well of course it is. Python code speed is always measured in lines per minute. That's why you should eliminate blank lin

Re: RAII vs gc (was fortran lib which provide python like data type)

2015-01-31 Thread Chris Angelico
On Sun, Feb 1, 2015 at 2:00 PM, Steven D'Aprano wrote: >> A C++ statement with RAII like >> >> { >>Foo bar(); >>// suite >> } >> >> is not equivalent to >> >> bar = Foo() >> >> in Python. It actually corresponds to >> >> with Foo() as bar: >> > > > Nice answer! I'm not qualified t

Re: Python is DOOMED! Again!

2015-01-31 Thread Steven D'Aprano
Chris Angelico wrote: > On Sat, Jan 31, 2015 at 10:56 PM, Steven D'Aprano > wrote: >> Both ints and floats are models of the same abstract thing, namely >> "number". Ideally, from a mathematically standpoint, there should be no >> difference between 23 and 23.0. Automatic coercions allow us to ge

Re: Python is DOOMED! Again!

2015-01-31 Thread Steven D'Aprano
Mario Figueiredo wrote: > In article <54ca5bbf$0$12992$c3e8da3$54964...@news.astraweb.com>, > steve+comp.lang.pyt...@pearwood.info says... >> >> Why should I feel guilty? You wrote: >> >> >> "Static analysis cannot and should not clutter executable code." >> >> >> But what are type declaratio

Re: Create dictionary based of x items per key from two lists

2015-01-31 Thread Mark Lawrence
On 31/01/2015 02:38, Chris Angelico wrote: On Sat, Jan 31, 2015 at 1:27 PM, wrote: l1 = ["a","b","c","d","e","f","g","h","i","j"] l2 = ["aR","bR","cR"] l2 will always be smaller or equal to l1 numL1PerL2 = len(l1)/len(l2) I want to create a dictionary that has key from l1 and value from l2

Re: RAII vs gc (was fortran lib which provide python like data type)

2015-01-31 Thread Steven D'Aprano
Sturla Molden wrote: > Rustom Mody wrote: > >> The case of RAII vs gc is hardly conclusive: >> >> http://stackoverflow.com/questions/228620/garbage-collection-in-c-why > > The purpose of RAII is not to be an alternative to garbage collection > (which the those answers imply), but to ensure de

Re: Create dictionary based of x items per key from two lists

2015-01-31 Thread Jason Friedman
> I have two lists > > l1 = ["a","b","c","d","e","f","g","h","i","j"] > l2 = ["aR","bR","cR"] > > l2 will always be smaller or equal to l1 > > numL1PerL2 = len(l1)/len(l2) > > I want to create a dictionary that has key from l1 and value from l2 based on > numL1PerL2 > > So > > { > a:aR, > b:aR, >

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

2015-01-31 Thread Rustom Mody
On Saturday, January 31, 2015 at 11:13:29 PM UTC+5:30, Marko Rauhamaa wrote: > Rustom Mody: > > > On Saturday, January 31, 2015 at 5:52:58 PM UTC+5:30, Marko Rauhamaa wrote: > >> Esthetically, I'm most impressed with Scheme. One day it might give > >> Python a run for its money. > > > > Aren't you

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

2015-01-31 Thread Steven D'Aprano
Marko Rauhamaa wrote: > I'm most impressed with Scheme. One day it might give > Python a run for its money. Scheme is forty years old, having come out in 1975. Python is 24 years old, having come out in 1991. If Scheme hasn't caught up with Python by now, it never will. -- Steven -- https:/

Re: [OT]very high tech humour

2015-01-31 Thread Ethan Furman
LOL! -- ~Ethan~ signature.asc Description: OpenPGP digital signature -- https://mail.python.org/mailman/listinfo/python-list

[OT]very high tech humour

2015-01-31 Thread Mark Lawrence
https://www.youtube.com/watch?v=kAG39jKi0lI -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.org/mailman/listinfo/python-list

Re: parsing tree from excel sheet

2015-01-31 Thread alb
Hi Peter, Peter Otten <__pete...@web.de> wrote: [] > Let's start with the simplest: > >> Peter Otten <__pete...@web.de> wrote: > >>>def show2(self): >>>yield str(self) >>>for child in self.children: >>>yield from child.show2() [] > > Given a tree > > A --> A1 >

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

2015-01-31 Thread Mark Lawrence
On 31/01/2015 15:50, Rustom Mody wrote: On Saturday, January 31, 2015 at 5:52:58 PM UTC+5:30, Marko Rauhamaa wrote: Esthetically, I'm most impressed with Scheme. One day it might give Python a run for its money. Marko Aren't you getting this backwards? http://www.wisdomandwonder.com/link/21

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

2015-01-31 Thread Marko Rauhamaa
Rustom Mody : > On Saturday, January 31, 2015 at 5:52:58 PM UTC+5:30, Marko Rauhamaa wrote: >> Esthetically, I'm most impressed with Scheme. One day it might give >> Python a run for its money. > > Aren't you getting this backwards? Deep down I'm a minimalist romantic. > Its just that its 2015 n

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

2015-01-31 Thread Rustom Mody
On Saturday, January 31, 2015 at 4:34:14 PM UTC+5:30, Steven D'Aprano wrote: > > Yesterday, as I wrote that message, my web browser crashed *eight times* in > a matter of half an hour. There are thousands of serious security > vulnerabilities due to mishandled pointers. Anyone who thinks that Linu

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

2015-01-31 Thread Rustom Mody
On Saturday, January 31, 2015 at 5:52:58 PM UTC+5:30, Marko Rauhamaa wrote: > Esthetically, I'm most impressed with Scheme. One day it might give > Python a run for its money. > > > Marko Aren't you getting this backwards? http://www.wisdomandwonder.com/link/2110/why-mit-switched-from-scheme-to

Re: Python is DOOMED! Again!

2015-01-31 Thread Chris Angelico
On Sat, Jan 31, 2015 at 10:56 PM, Steven D'Aprano wrote: > Both ints and floats are models of the same abstract thing, namely "number". > Ideally, from a mathematically standpoint, there should be no difference > between 23 and 23.0. Automatic coercions allow us to get a little closer to > that id

Re: AssertionError (3.X only) when calling Py_Finalize with threads

2015-01-31 Thread Antoine Pitrou
Hi Tom, Tom Kent gmail.com> writes: > > I'm getting an error output when I call the C-API's Py_Finalize() from a different C-thread than I made a > python call on. Can you please post a bug on https://bugs.python.org ? Be sure to upload your example there. Thank you Antoine. -- https://ma

Re: Python tracker manual password reset

2015-01-31 Thread Marko Rauhamaa
Terry Reedy : > On 1/30/2015 10:46 AM, Ian Kelly wrote: >> Is there someone I can contact to have my password manually reset? > > Answered offline. Spoilsport. Marko -- https://mail.python.org/mailman/listinfo/python-list

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

2015-01-31 Thread Marko Rauhamaa
Gregory Ewing : > I'm completely convinced nowadays that there is *no* use case for C++. While I wouldn't go quite that far (my most recent creation was written in C++; why? because the legacy support libraries were written in C++). However, C++ is like putting lipstick on a pig. In fact, C++ ha

Re: Python is DOOMED! Again!

2015-01-31 Thread Steven D'Aprano
random...@fastmail.us wrote: > 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 *so

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

2015-01-31 Thread Steven D'Aprano
Michael Torrie wrote: > On 01/30/2015 04:50 PM, Steven D'Aprano wrote: >> Oh great. So if the average application creates a hundred thousand >> pointers of the course of a session, you'll only have a thousand or so >> seg faults and leaks. >> >> Well, that certainly explains this: >> >> https://

Re: help() function screen output

2015-01-31 Thread Terry Reedy
On 1/31/2015 4:13 AM, Steven D'Aprano wrote: Jacob Kruger wrote: Using python 3.4 32 bit on windows 7 64 bit machine, and when, for example, type in something like the following in interpreter window: help(str) It will populate the screen with one full screen of information, with a prompt of -

Re: help() function screen output

2015-01-31 Thread Jacob Kruger
- Original Message - > Specifically, the last two lines show: Display next page Display next line which is, I suspect, what you're after here. (If you're interested, the code for all this is in the pydoc module (Lib\pydoc.py) in the getpager() function. TJG -- https://mail.pytho

Re: help() function screen output

2015-01-31 Thread Jacob Kruger
- Original Message - From: "Steven D'Aprano" Newsgroups: comp.lang.python To: Sent: Saturday, January 31, 2015 11:13 AM Subject: Re: help() function screen output Jacob Kruger wrote: Using python 3.4 32 bit on windows 7 64 bit machine, and when, for example, type in something like

Re: help() function screen output

2015-01-31 Thread Tim Golden
On 31/01/2015 08:17, Jacob Kruger wrote: Using python 3.4 32 bit on windows 7 64 bit machine, and when, for example, type in something like the following in interpreter window: help(str) It will populate the screen with one full screen of information, with a prompt of --more-- to hit enter, or so

Re: A python coder needed

2015-01-31 Thread Fatih Bazman
On Saturday, January 31, 2015 at 11:11:02 AM UTC+2, Chris Angelico wrote: > On Sat, Jan 31, 2015 at 7:51 PM, wrote: > > Hello. I am looking for a python coder. Please find the details which are > > in the below: > > > > A bittorrent client will be coded in order to share files in a private > >

Re: help() function screen output

2015-01-31 Thread Steven D'Aprano
Jacob Kruger wrote: > Using python 3.4 32 bit on windows 7 64 bit machine, and when, for > example, type in something like the following in interpreter window: > help(str) > > It will populate the screen with one full screen of information, with a > prompt of --more-- to hit enter, or something t

Re: parsing tree from excel sheet

2015-01-31 Thread Peter Otten
alb wrote: > > > > def read_tree(rows, levelnames): > >root = Node("#ROOT", "#ROOT") > >old_level = 0 > >stack = [root] > >for i, row in enumerate(rows, 1): > > I'm not quite sure I understand what is the stack for. As of now is a > list whose only element is root. The stack is

Re: A python coder needed

2015-01-31 Thread Chris Angelico
On Sat, Jan 31, 2015 at 7:51 PM, wrote: > Hello. I am looking for a python coder. Please find the details which are in > the below: > > A bittorrent client will be coded in order to share files in a private group. > The private tracker server was coded by me (PHP & MySQL) and bittorrent > clie

Re: parsing tree from excel sheet

2015-01-31 Thread Peter Otten
alb wrote: > > > > def read_tree(rows, levelnames): > >root = Node("#ROOT", "#ROOT") > >old_level = 0 > >stack = [root] > >for i, row in enumerate(rows, 1): > > I'm not quite sure I understand what is the stack for. As of now is a > list whose only element is root. The stack is

A python coder needed

2015-01-31 Thread fatihbazman
Hello. I am looking for a python coder. Please find the details which are in the below: A bittorrent client will be coded in order to share files in a private group. The private tracker server was coded by me (PHP & MySQL) and bittorrent client will be communicated with this tracker server via

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

2015-01-31 Thread Christian Gollwitzer
Am 30.01.15 um 19:23 schrieb Paul Rubin: > Michael Torrie writes: >> Follow basic [C++] rules and 99% of segfaults will never happen and >> the majority of leaks will not happen either. > > That is a safe and simple approach, but it works by copying data all > over the place instead of passing po

help() function screen output

2015-01-31 Thread Jacob Kruger
Using python 3.4 32 bit on windows 7 64 bit machine, and when, for example, type in something like the following in interpreter window: help(str) It will populate the screen with one full screen of information, with a prompt of --more-- to hit enter, or something to continue displaying informati

Re: Python tracker manual password reset

2015-01-31 Thread Terry Reedy
On 1/30/2015 10:46 AM, Ian Kelly wrote: I just tried to use the password recovery tool for the Python tracker. I entered my personal email. It sent me the confirmation email with the password reset link, which I followed. It then reset my password and sent an email to a different address, an old