Re: Standard class for time *period*?

2023-03-29 Thread Cameron Simpson
On 29Mar2023 08:17, Loris Bennett wrote: I am glad to hear that I am not alone :-) However, my use-case is fairly trivial, indeed less complicated than yours. So, in truth I don't really need a Period class. I just thought it might be a sufficiently generic itch that someone else with a more c

Re: Standard class for time *period*?

2023-03-29 Thread Cameron Simpson
On 30Mar2023 10:13, Cameron Simpson wrote: I do in fact have a `TimePartition` in my timeseries module; it presently doesn't do comparisons because I'm not comparing them - I'm just using them as slices into the timeseries data on the whole. https://github.com/cameron-simpson/css/blob/0ade6d1

Re: Standard class for time *period*?

2023-03-29 Thread Thomas Passin
On 3/29/2023 2:17 AM, Loris Bennett wrote: I am glad to hear that I am not alone :-) However, my use-case is fairly trivial, indeed less complicated than yours. So, in truth I don't really need a Period class. I just thought it might be a sufficiently generic itch that someone else with a more

Re: Standard class for time *period*?

2023-03-29 Thread Loris Bennett
Cameron Simpson writes: > On 28Mar2023 08:05, Dennis Lee Bieber wrote: >> So far, you seem to be the only person who has ever asked for >> asingle >>entity incorporating an EPOCH (datetime.datetime) + a DURATION >>(datetime.timedelta). > > But not the only person to want one. I've got a

Re: Standard class for time *period*?

2023-03-28 Thread Cameron Simpson
On 28Mar2023 08:05, Dennis Lee Bieber wrote: So far, you seem to be the only person who has ever asked for a single entity incorporating an EPOCH (datetime.datetime) + a DURATION (datetime.timedelta). But not the only person to want one. I've got a timeseries data format where (within a fi

Re: Standard class for time *period*?

2023-03-28 Thread dn via Python-list
1. Is there a standard class for a 'period', i.e. length of time specified by a start point and an end point? The start and end points could obviously be datetimes and the difference a timedelta, but the period '2022-03-01 00:00 to 2022-03-02 00:00' would be different to '2023-03-01 0

Re: Standard class for time *period*?

2023-03-28 Thread Grant Edwards
On 2023-03-28, Thomas Passin wrote: > On 3/28/2023 12:13 PM, Grant Edwards wrote: >> On 2023-03-28, Dennis Lee Bieber wrote: >> >>> So far, you seem to be the only person who has ever asked for a >>> single entity incorporating an EPOCH (datetime.datetime) + a >>> DURATION (datetime.timedelta).

Re: Standard class for time *period*?

2023-03-28 Thread Thomas Passin
On 3/28/2023 12:13 PM, Grant Edwards wrote: On 2023-03-28, Dennis Lee Bieber wrote: So far, you seem to be the only person who has ever asked for a single entity incorporating an EPOCH (datetime.datetime) + a DURATION (datetime.timedelta). It seems to me that tuple of two timdate objects (st

Re: Standard class for time *period*?

2023-03-28 Thread Grant Edwards
On 2023-03-28, Dennis Lee Bieber wrote: > So far, you seem to be the only person who has ever asked for a > single entity incorporating an EPOCH (datetime.datetime) + a > DURATION (datetime.timedelta). It seems to me that tuple of two timdate objects (start,end) is the more obvious representatio

Aw: Re: Standard class for time *period*?

2023-03-28 Thread Karsten Hilbert
> No, it doesn't. I already know about timedelta. I must have explained > the issue badly, because everyone seems to be fixating on the > formatting, which is not a problem and is incidental to what I am really > interested in, namely: > > 1. Is there a standard class for a 'period', i.e. length

Re: Standard class for time *period*?

2023-03-28 Thread rbowman
On Tue, 28 Mar 2023 15:11:14 +0200, Loris Bennett wrote: > But even if I have a single epoch, January 2022 is obviously different > to January 2023, even thought the duration might be the same. I am just > surprised that there is no standard Period class, with which I could > create objects and

Re: Standard class for time *period*?

2023-03-28 Thread Dennis Lee Bieber
On Tue, 28 Mar 2023 08:14:55 +0200, "Loris Bennett" declaimed the following: > >No, it doesn't. I already know about timedelta. I must have explained >the issue badly, because everyone seems to be fixating on the >formatting, which is not a problem and is incidental to what I am really >interes

Re: Standard class for time *period*?

2023-03-28 Thread Loris Bennett
Thomas Passin writes: > On 3/27/2023 11:34 AM, rbowman wrote: >> On Mon, 27 Mar 2023 15:00:52 +0200, Loris Bennett wrote: >> >>>I need to deal with what I call a 'period', which is a span of time >>>limited by two dates, start and end. The period has a 'duration', >>>which is the el

Re: Standard class for time *period*?

2023-03-28 Thread Loris Bennett
Dennis Lee Bieber writes: > On Tue, 28 Mar 2023 08:14:55 +0200, "Loris Bennett" > declaimed the following: > >> >>No, it doesn't. I already know about timedelta. I must have explained >>the issue badly, because everyone seems to be fixating on the >>formatting, which is not a problem and is in

Re: Standard class for time *period*?

2023-03-27 Thread Thomas Passin
On 3/27/2023 11:34 AM, rbowman wrote: On Mon, 27 Mar 2023 15:00:52 +0200, Loris Bennett wrote: I need to deal with what I call a 'period', which is a span of time limited by two dates, start and end. The period has a 'duration', which is the elapsed time between start and end. The d

Re: Standard class for time *period*?

2023-03-27 Thread Gary Herron
The Python standard library module datetime seems to be what you want.  It has objects representing date/times, and deltatimes (i.e., durations).  These can be timezone aware or not as you wish. Dr. Gary Herron Professor of Computer Science DigiPen Institute of Technology On 3/27/23 6:00 AM, l

Re: Standard class for time *period*?

2023-03-27 Thread rbowman
On Mon, 27 Mar 2023 15:00:52 +0200, Loris Bennett wrote: > I need to deal with what I call a 'period', which is a span of time > limited by two dates, start and end. The period has a 'duration', > which is the elapsed time between start and end. The duration is > essentially a number of

Re: Standard class for time *period*?

2023-03-27 Thread Loris Bennett
r...@zedat.fu-berlin.de (Stefan Ram) writes: > r...@zedat.fu-berlin.de (Stefan Ram) writes: >>d = datetime_diff.days >>h, rem = divmod( datetime_diff.seconds, 3600 ) >>m, s = divmod( rem, 60 ) >>print( f'{d:02}-{h:02}:{m:02}:{s:02}' ) > > If the default formatting is acceptable to you, you can a

Re: Standard for dict-contants with duplicate keys?

2017-09-15 Thread Tim Chase
On 2017-09-15 17:45, Terry Reedy wrote: > On 9/15/2017 3:36 PM, Tim Chase wrote: > >d = { > > "a": 0, > > "a": 1, > > "a": 2, > >} > > > > In my limited testing, it appears to always take the last one, > > resulting in > > > >{"a": 2} > > > > Is this guaranteed

Re: Standard for dict-contants with duplicate keys?

2017-09-15 Thread Serhiy Storchaka
16.09.17 00:45, Terry Reedy пише: On 9/15/2017 3:36 PM, Tim Chase wrote: Looking through docs, I was unable to tease out whether there's a prescribed behavior for the results of defining a dictionary with the same keys multiple times d = { "a": 0, "a": 1, "a": 2, }

Re: Standard for dict-contants with duplicate keys?

2017-09-15 Thread Peter Otten
Tim Chase wrote: > Looking through docs, I was unable to tease out whether there's a > prescribed behavior for the results of defining a dictionary with the > same keys multiple times > > d = { > "a": 0, > "a": 1, > "a": 2, > } > > In my limited testing, it appears to alwa

Re: Standard for dict-contants with duplicate keys?

2017-09-15 Thread Terry Reedy
On 9/15/2017 3:36 PM, Tim Chase wrote: Looking through docs, I was unable to tease out whether there's a prescribed behavior for the results of defining a dictionary with the same keys multiple times d = { "a": 0, "a": 1, "a": 2, } In my limited testing, it appears t

Re: Standard lib version of something like enumerate() that takes a max count iteration parameter?

2017-06-16 Thread Peter Otten
Andre Müller wrote: > # to impress your friends you can do > for chunk in itertools.zip_longest(*[iter(s)]*4): > chunked_str = ''.join(c for c in chunk if c) # generator expression > inside join with condition > print(chunked_str) This can be simplified with a fillvalue >>> s = "abracad

Re: Standard lib version of something like enumerate() that takes a max count iteration parameter?

2017-06-16 Thread Andre Müller
Am 15.06.2017 um 07:09 schrieb Jussi Piitulainen: > Andre Müller writes: > >> I'm a fan of infinite sequences. Try out itertools.islice. >> You should not underestimate this very important module. >> >> Please read also the documentation: >> https://docs.python.org/3.6/library/itertools.html >> >>

Re: Standard lib version of something like enumerate() that takes a max count iteration parameter?

2017-06-14 Thread Jussi Piitulainen
Andre Müller writes: > I'm a fan of infinite sequences. Try out itertools.islice. > You should not underestimate this very important module. > > Please read also the documentation: > https://docs.python.org/3.6/library/itertools.html > > from itertools import islice > > iterable = range(10

Re: Standard lib version of something like enumerate() that takes a max count iteration parameter?

2017-06-14 Thread Andre Müller
I'm a fan of infinite sequences. Try out itertools.islice. You should not underestimate this very important module. Please read also the documentation: https://docs.python.org/3.6/library/itertools.html from itertools import islice iterable = range(100) # since Python 3 range is a lazy e

Re: Standard lib version of something like enumerate() that takes a max count iteration parameter?

2017-06-14 Thread Malcolm Greene
Thank you Peter and Jussi - both your solutions were very helpful! Malcolm -- https://mail.python.org/mailman/listinfo/python-list

Re: Standard lib version of something like enumerate() that takes a max count iteration parameter?

2017-06-14 Thread Jussi Piitulainen
Malcolm Greene writes: > Wondering if there's a standard lib version of something like > enumerate() that takes a max count value? > Use case: When you want to enumerate through an iterable, but want to > limit the number of iterations without introducing if-condition-break > blocks in code. > Som

Re: Standard lib version of something like enumerate() that takes a max count iteration parameter?

2017-06-14 Thread Peter Otten
Malcolm Greene wrote: > Wondering if there's a standard lib version of something like > enumerate() that takes a max count value? > Use case: When you want to enumerate through an iterable, but want to > limit the number of iterations without introducing if-condition-break > blocks in code. > Some

Re: Standard

2015-02-23 Thread jkn
On Sunday, 22 February 2015 14:11:54 UTC, Mark Lawrence wrote: > On 19/02/2015 16:27, Phillip Fleming wrote: > > In my opinion, Python will not take off like C/C++ if there is no ANSI > > standard. > > > > Python has already taken off because it doesn't have a standard as such. > Bjarne Stroust

Re: Standard

2015-02-22 Thread Steven D'Aprano
Skip Montanaro wrote: > On Thu, Feb 19, 2015 at 10:27 AM, Phillip Fleming > wrote: >> In my opinion, Python will not take off like C/C++ if there is no ANSI >> standard. > > On one side of your statement, what makes you think Python ever wanted > to "take off like C/C++"? On the other side, ther

Re: Standard

2015-02-22 Thread Mark Lawrence
On 19/02/2015 16:27, Phillip Fleming wrote: In my opinion, Python will not take off like C/C++ if there is no ANSI standard. Python has already taken off because it doesn't have a standard as such. -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our

Re: Standard

2015-02-22 Thread Skip Montanaro
On Thu, Feb 19, 2015 at 10:27 AM, Phillip Fleming wrote: > In my opinion, Python will not take off like C/C++ if there is no ANSI > standard. On one side of your statement, what makes you think Python ever wanted to "take off like C/C++"? On the other side, there are other languages (Java, PHP, P

Re: Standard library Help

2014-07-11 Thread Neil D. Cerutti
On 7/11/2014 4:53 AM, Wolfgang Maier wrote: On 07/11/2014 10:32 AM, Nicholas Cannon wrote: Hey i would like to know alot more about the standard library and all of its functions and so on and i know it is huge and i would basically like to learn only the useful stuff that i could use and all of

Re: Standard library Help

2014-07-11 Thread Wolfgang Maier
On 07/11/2014 10:32 AM, Nicholas Cannon wrote: Hey i would like to know alot more about the standard library and all of its functions and so on and i know it is huge and i would basically like to learn only the useful stuff that i could use and all of those features. i have been looking around

Re: Standard library Help

2014-07-11 Thread Ben Finney
Nicholas Cannon writes: > Hey i would like to know alot more about the standard library and all > of its functions and so on Welcome! This is a good goal, familiarity with the standard library is a very important way to save yourself time in programming. > and i know it is huge and i would basi

Re: Standard library Help

2014-07-11 Thread Steven D'Aprano
On Fri, 11 Jul 2014 01:32:32 -0700, Nicholas Cannon wrote: > Hey i would like to know alot more about the standard library and all of > its functions and so on and i know it is huge and i would basically like > to learn only the useful stuff that i could use and all of those > features. i have bee

Re: Standard library Help

2014-07-11 Thread marco . nawijn
On Friday, July 11, 2014 10:32:32 AM UTC+2, Nicholas Cannon wrote: > Hey i would like to know alot more about the standard library and all of its > functions and so on and i know it is huge and i would basically like to learn > only the useful stuff that i could use and all of those features. i h

Re: Standard way to generate mail/news reply?

2014-06-26 Thread Adam Funk
On 2014-06-24, Skip Montanaro wrote: > On Tue, Jun 24, 2014 at 6:46 AM, Adam Funk wrote: >> Is there some standard library or code for taking an e-mail or >> newsgroup message & generating a reply to it? > > You might try searching for "mail reply" on pypi.python.org. That will > return a number

Re: Standard way to generate mail/news reply?

2014-06-24 Thread Skip Montanaro
On Tue, Jun 24, 2014 at 6:46 AM, Adam Funk wrote: > Is there some standard library or code for taking an e-mail or > newsgroup message & generating a reply to it? You might try searching for "mail reply" on pypi.python.org. That will return a number of hits. I know the python.org replybot is ther

Re: Standard Delay Format (SDF) Parsing

2014-05-26 Thread moogyd
On Monday, 26 May 2014 08:15:53 UTC+2, garg.p...@gmail.com wrote: > Hi Steven, > > > > did you get the module to parse the sdf file? > > > > regards, > > pankaj Unfortunately not. I actually can't remember why I wanted/needed this. I guess that it wasn't that important since I didn't act

Re: Standard Delay Format (SDF) Parsing

2014-05-25 Thread garg . pankaj83
Hi Steven, did you get the module to parse the sdf file? regards, pankaj -- https://mail.python.org/mailman/listinfo/python-list

Re: Standard Asynchronous Python

2012-09-15 Thread Bryan
Dustin J. Mitchell wrote: > Thanks for the second round of responses.  I think this gives me some > focus - concentrate on the API, talk to the framework developers, and > start redrafting the PEP sooner rather than later. That's mostly what you came in with, but talking to the framework developer

Re: Standard Asynchronous Python

2012-09-11 Thread Dustin J. Mitchell
Thanks for the second round of responses. I think this gives me some focus - concentrate on the API, talk to the framework developers, and start redrafting the PEP sooner rather than later. Thanks! Dustin -- http://mail.python.org/mailman/listinfo/python-list

Re: Standard Asynchronous Python

2012-09-10 Thread Terry Reedy
On 9/10/2012 7:36 AM, Dustin J. Mitchell wrote: The responses have certainly highlighted some errors in emphasis in my approach. * My idea is to propose a design PEP. (Steven, Dennis) I'm not at *all* suggesting including uthreads in the standard library. It's a toy implementation I used to dev

Re: Standard Asynchronous Python

2012-09-10 Thread Oscar Benjamin
On 2012-09-10, Dennis Lee Bieber wrote: > On Sun, 9 Sep 2012 20:07:51 -0400, "Dustin J. Mitchell" > declaimed the following in > gmane.comp.python.general: > >> >> My proposal met with near-silence, and I didn't pursue it. Instead, I >> did what any self-respecting hacker would do - I wrote up a

Re: Standard Asynchronous Python

2012-09-10 Thread Steven D'Aprano
On Mon, 10 Sep 2012 07:36:11 -0400, Dustin J. Mitchell wrote: > The responses have certainly highlighted some errors in emphasis in my > approach. > > * My idea is to propose a design PEP. (Steven, Dennis) I'm not at *all* > suggesting including uthreads in the standard library. It's a toy > imp

Re: Standard Asynchronous Python

2012-09-10 Thread Dustin J. Mitchell
The responses have certainly highlighted some errors in emphasis in my approach. * My idea is to propose a design PEP. (Steven, Dennis) I'm not at *all* suggesting including uthreads in the standard library. It's a toy implementation I used to develop my ideas. I think of this as a much smaller

Re: Standard Asynchronous Python

2012-09-09 Thread Bryan
Dustin J. Mitchell wrote: > After seeing David Mertz's talk at PyCon 2012, "Coroutines, event > loops, and the history of Python generators" [1], I got thinking again > about Python's expressive power for asynchronous programming. I lament the confusion of generators and coroutines. Generators are

Re: Standard Asynchronous Python

2012-09-09 Thread Steven D'Aprano
On Sun, 09 Sep 2012 20:07:51 -0400, Dustin J. Mitchell wrote: > After seeing David Mertz's talk at PyCon 2012, "Coroutines, event loops, > and the history of Python generators" [1], I got thinking again about > Python's expressive power for asynchronous programming. [...] > I'm considering re-draf

Re: Standard Deviation One-liner

2011-06-05 Thread Ethan Furman
Steven D'Aprano wrote: On Fri, 03 Jun 2011 13:09:43 -0700, Raymond Hettinger wrote: On Jun 3, 10:55 am, Billy Mays wrote: I'm trying to shorten a one-liner I have for calculating the standard deviation of a list of numbers. I have something so far, but I was wondering if it could be made any

Re: Standard Deviation One-liner

2011-06-05 Thread Steven D'Aprano
On Fri, 03 Jun 2011 13:09:43 -0700, Raymond Hettinger wrote: > On Jun 3, 10:55 am, Billy Mays wrote: >> I'm trying to shorten a one-liner I have for calculating the standard >> deviation of a list of numbers.  I have something so far, but I was >> wondering if it could be made any shorter (withou

Re: Standard Deviation One-liner

2011-06-03 Thread Raymond Hettinger
On Jun 3, 10:55 am, Billy Mays wrote: > I'm trying to shorten a one-liner I have for calculating the standard > deviation of a list of numbers.  I have something so far, but I was > wondering if it could be made any shorter (without imports). > > Here's my function: > > a=lambda d:(sum((x-1.*sum(d

Re: Standard Deviation One-liner

2011-06-03 Thread Alain Ketterlin
Alain Ketterlin writes: > aux = lambda s1,s2,n: (s2 - s1*s1/n)/(n-1) > sv = lambda d: aux(sum(d),sum(x*x for x in d),len(d)) Err, sorry, the final square root is missing. -- Alain. -- http://mail.python.org/mailman/listinfo/python-list

Re: Standard Deviation One-liner

2011-06-03 Thread Alain Ketterlin
Billy Mays writes: > I'm trying to shorten a one-liner I have for calculating the standard > deviation of a list of numbers. I have something so far, but I was > wondering if it could be made any shorter (without imports). > a=lambda d:(sum((x-1.*sum(d)/len(d))**2 for x in d)/(1.*(len(d)-1)))**

Re: Standard config file format

2011-04-06 Thread Neil Cerutti
On 2011-04-06, Chris Rebert wrote: > On Tue, Apr 5, 2011 at 7:16 PM, Vincent Davis > wrote: >> I am working on a program to monitor directory file changes >> and am would like a configuration file. This file would >> specify email addresses, file and directory locations.. Is >> there a prefer

Re: Standard config file format

2011-04-05 Thread Chris Rebert
On Tue, Apr 5, 2011 at 7:16 PM, Vincent Davis wrote: > I am working on a program to monitor directory file changes and am would > like a configuration file. This file would specify email addresses, file and > directory locations.. Is there a preferred format to use with python? ConfigParser s

Re: Standard way to distribute utilities with packages

2011-03-27 Thread Sridhar Ratnakumar
On Sunday, March 27, 2011 at 1:05 PM, Laszlo Nagy wrote: I'd like to distribute a pure Python package named "foo". By default it > will be placed in lib/site-packages/foo. What if I want to add > utilities? Command line or GUI programs that are not full featured > applications, but they can be h

Re: Standard way to distribute utilities with packages

2011-03-27 Thread eryksun ()
On Sunday, March 27, 2011 4:05:30 PM UTC-4, Laszlo Nagy wrote: > I'd like to distribute a pure Python package named "foo". By default it > will be placed in lib/site-packages/foo. What if I want to add > utilities? Command line or GUI programs that are not full featured > applications, but they

Re: Standard module implementation

2010-11-29 Thread Daniel Molina Wegener
On Domingo 28 Noviembre 2010 11:08, candide wrote: > I was wondering if all the standard module are implemented in C. For > instance, I can't find a C implementation for the minidom xml parser > under Python 2.6. If you are looking for a C implementation of DOM as Python Extension, you can try

Re: Standard module implementation

2010-11-28 Thread Chris Rebert
On Sun, Nov 28, 2010 at 6:08 AM, candide wrote: > I was wondering if all the standard module are implemented in C. For > instance, I can't find a C implementation for the minidom xml parser under > Python 2.6. As was already said, no; a significant portion if not the majority of the std lib is wr

Re: Standard module implementation

2010-11-28 Thread Benjamin Kaplan
On Sun, Nov 28, 2010 at 9:08 AM, candide wrote: > I was wondering if all the standard module are implemented in C. For > instance, I can't find a C implementation for the minidom xml parser under > Python 2.6. > -- No they aren't. A good chunk of the standard library is implemented in Python. Whi

Re: Standard library function to remove folder with files and subfolders?

2010-09-18 Thread Philip Semanchuk
On Sep 18, 2010, at 5:24 PM, pyt...@bdurham.com wrote: > Is there a standard library function to remove a folder that may > contain files and subfolders? Or must I write a function that > walks my folder's children and deletes all files/subfolders > first, and then call os.removedirs()? In Pytho

Re: Standard Library SSL Module (was: Python OpenSSL library)

2010-06-14 Thread geremy condra
On Mon, Jun 14, 2010 at 1:48 PM, Antoine Pitrou wrote: > On Mon, 14 Jun 2010 15:54:33 -0400 > Michael Crute wrote: >> On Mon, Jun 14, 2010 at 1:25 PM, Antoine Pitrou wrote: >> > That was not my question. My question was whether there was a reason to >> > rewrite a separate OpenSSL-accessing libr

Re: Standard Library SSL Module (was: Python OpenSSL library)

2010-06-14 Thread Antoine Pitrou
On Mon, 14 Jun 2010 15:54:33 -0400 Michael Crute wrote: > On Mon, Jun 14, 2010 at 1:25 PM, Antoine Pitrou wrote: > > That was not my question. My question was whether there was a reason to > > rewrite a separate OpenSSL-accessing library rather than contributing to > > improve the "hashlib" and "

Re: standard libraries don't behave like standard 'libraries'

2009-11-12 Thread Benjamin Kaplan
On Thu, Nov 12, 2009 at 12:05 PM, Sriram Srinivasan wrote: >> So all libraries written have to use the common subset, which - unless >> things are *removed*, which with python3 actually happened - is always >> the oldest interpreter. And if a feature goes away, they have to be >> rewritten with th

Re: standard libraries don't behave like standard 'libraries'

2009-11-12 Thread Sriram Srinivasan
> So all libraries written have to use the common subset, which - unless > things are *removed*, which with python3 actually happened - is always > the oldest interpreter. And if a feature goes away, they have to be > rewritten with the then common subset. you see that's the problem with py3. inst

Re: standard libraries don't behave like standard 'libraries'

2009-11-12 Thread Diez B. Roggisch
Sriram Srinivasan schrieb: On Nov 12, 6:07 pm, "Diez B. Roggisch" wrote: ok let me make it more clear.. forget how you use python now.. i am talking about __futuristic__ python programming. there is no more python2.x or python3.x or python y.x releases. there is only updates of python and stand

Re: standard libraries don't behave like standard 'libraries'

2009-11-12 Thread Sriram Srinivasan
> You are describing a lending library, which is not the only sort of > library. My personal library doesn't do any of those things. It is just a > room with shelves filled with books. how i see is all libraries are libraries, for a personal library you are the only customer and you are the manag

Re: standard libraries don't behave like standard 'libraries'

2009-11-12 Thread Sriram Srinivasan
On Nov 12, 6:07 pm, "Diez B. Roggisch" wrote: > > ok let me make it more clear.. > > forget how you use python now.. i am talking about __futuristic__ > > python programming. > > > there is no more python2.x or python3.x or python y.x releases. there > > is only updates of python and standard libr

Re: standard libraries don't behave like standard 'libraries'

2009-11-12 Thread Steven D'Aprano
On Thu, 12 Nov 2009 00:31:57 -0800, Sriram Srinivasan wrote: > I guess why every programming language has some kind of a 'standard > library' built in within it. > In my view it must not be called as a 'library' at all. what it does is > like a 'bunch of built-in programs ready-made to do stuff'.

Re: standard libraries don't behave like standard 'libraries'

2009-11-12 Thread Diez B. Roggisch
ok let me make it more clear.. forget how you use python now.. i am talking about __futuristic__ python programming. > there is no more python2.x or python3.x or python y.x releases. there is only updates of python and standard library say 1.1.5 and 1.1.6. let the difference be an old xml libr

Re: standard libraries don't behave like standard 'libraries'

2009-11-12 Thread Sriram Srinivasan
On Nov 12, 4:35 pm, "Diez B. Roggisch" wrote: > Sriram Srinivasan schrieb: > > > > > On Nov 12, 3:56 pm, "Diez B. Roggisch" wrote: > >> Sriram Srinivasan schrieb: > > >>> I guess why every programming language has some kind of a 'standard > >>> library' built in within it. > >>> In my view it mus

Re: standard libraries don't behave like standard 'libraries'

2009-11-12 Thread Diez B. Roggisch
Sriram Srinivasan schrieb: On Nov 12, 3:56 pm, "Diez B. Roggisch" wrote: Sriram Srinivasan schrieb: I guess why every programming language has some kind of a 'standard library' built in within it. In my view it must not be called as a 'library' at all. what it does is like a 'bunch of built

Re: standard libraries don't behave like standard 'libraries'

2009-11-12 Thread Sriram Srinivasan
On Nov 12, 3:56 pm, "Diez B. Roggisch" wrote: > Sriram Srinivasan schrieb: > > > > > I guess why every programming language has some kind of a 'standard > > library' built in within it. > > In my view it must not be called as a 'library' at all. what it does > > is like a 'bunch of built-in progra

Re: standard libraries don't behave like standard 'libraries'

2009-11-12 Thread Diez B. Roggisch
Sriram Srinivasan schrieb: On Nov 12, 3:56 pm, "Diez B. Roggisch" wrote: Sriram Srinivasan schrieb: I guess why every programming language has some kind of a 'standard library' built in within it. In my view it must not be called as a 'library' at all. what it does is like a 'bunch of built

Re: standard libraries don't behave like standard 'libraries'

2009-11-12 Thread Sriram Srinivasan
On Nov 12, 3:56 pm, "Diez B. Roggisch" wrote: > Sriram Srinivasan schrieb: > > > > > I guess why every programming language has some kind of a 'standard > > library' built in within it. > > In my view it must not be called as a 'library' at all. what it does > > is like a 'bunch of built-in progra

Re: standard libraries don't behave like standard 'libraries'

2009-11-12 Thread Diez B. Roggisch
Sriram Srinivasan schrieb: I guess why every programming language has some kind of a 'standard library' built in within it. In my view it must not be called as a 'library' at all. what it does is like a 'bunch of built-in programs ready-made to do stuff'. Lets see what a 'library' does: 1. offe

Re: Standard IPC for Python?

2009-01-15 Thread Mel
Mel wrote: > Philip Semanchuk wrote: > >> I'm working on message queue support, but the Sys V IPC API is a >> headache and takes longer to code against than the POSIX API. > > I hadn't found it that bad. I have a C extension I should perhaps clean > up and make public. I have a simple wrapper

Re: Standard IPC for Python?

2009-01-14 Thread sturlamolden
On Jan 14, 12:47 pm, Laszlo Nagy wrote: > multiprocessing.Queue cannot be used as a general message queue > between arbitrary processes. Then e.g. use Listener and Client in multiprocessing.connection to create a named pipe (AF_PIPE). Or use win32pipe.CreateNamedPipe from pywin32. > - mmap.mma

Re: Standard IPC for Python?

2009-01-14 Thread Laszlo Nagy
There are plenty of different IPC mechanisms available in multiprocessing. It is good for a special case: a tree of processes, forked from a main process. multiprocessing.Queue cannot be used as a general message queue between arbitrary processes. - mmap.mmap with 0 or -1 as the first argu

Re: Standard IPC for Python?

2009-01-14 Thread sturlamolden
On Jan 13, 5:25 pm, Laszlo Nagy wrote: > I would like to develop some module for Python for IPC. Socket > programming howto recommends that for local communication, and I > personally experienced problems with TCP (see my previous post: "Slow > network"). There are plenty of different IPC mechan

Re: Standard IPC for Python?

2009-01-13 Thread Philip Semanchuk
On Jan 13, 2009, at 11:26 PM, drobi...@gmail.com wrote: On Jan 13, 5:08 pm, Philip Semanchuk wrote: On Jan 13, 2009, at 4:31 PM, drobi...@gmail.com wrote: On Jan 13, 2:37 pm, Philip Semanchuk wrote: I was suggesting getting posix_ipc or sysv_ipc to compile against a compatibility library

Re: Standard IPC for Python?

2009-01-13 Thread drobi...@gmail.com
On Jan 13, 5:08 pm, Philip Semanchuk wrote: > On Jan 13, 2009, at 4:31 PM, drobi...@gmail.com wrote: > > > On Jan 13, 2:37 pm, Philip Semanchuk wrote: > >> I was suggesting getting posix_ipc or sysv_ipc to compile against a > >> compatibility library (Cygwin?) under Windows. It sounds like you're

Re: Standard IPC for Python?

2009-01-13 Thread Philip Semanchuk
On Jan 13, 2009, at 6:41 PM, Mel wrote: Philip Semanchuk wrote: I'm working on message queue support, but the Sys V IPC API is a headache and takes longer to code against than the POSIX API. I hadn't found it that bad. I have a C extension I should perhaps clean up and make public. Ha

Re: Standard IPC for Python?

2009-01-13 Thread James Mills
On Wed, Jan 14, 2009 at 3:40 AM, Laszlo Nagy wrote: > Can anyone tell me if select.select works under OS X? Yes it does. cheers James -- http://mail.python.org/mailman/listinfo/python-list

Re: Standard IPC for Python?

2009-01-13 Thread James Mills
On Wed, Jan 14, 2009 at 2:25 AM, Laszlo Nagy wrote: > The question is: what is the standard way to implement fast and portable IPC > with Python? Are there tools in the standard lib that can do this? Certainly not standard by any means, but I use circuits (1). Two or more processes can communicat

Re: Standard IPC for Python?

2009-01-13 Thread Terry Reedy
Laszlo Nagy wrote: I was suggesting getting posix_ipc or sysv_ipc to compile against a compatibility library (Cygwin?) under Windows. It sounds like you're proposing something totally different, no? OK I see. But probably I do not want to use Cygwin because that would create another depende

Re: Standard IPC for Python?

2009-01-13 Thread Mel
Philip Semanchuk wrote: > I'm working on message queue support, but the Sys V IPC API is a > headache and takes longer to code against than the POSIX API. I hadn't found it that bad. I have a C extension I should perhaps clean up and make public. Mel. -- http://mail.python.org/mailman/

Re: Standard IPC for Python?

2009-01-13 Thread Philip Semanchuk
On Jan 13, 2009, at 4:31 PM, drobi...@gmail.com wrote: On Jan 13, 2:37 pm, Philip Semanchuk wrote: I was suggesting getting posix_ipc or sysv_ipc to compile against a compatibility library (Cygwin?) under Windows. It sounds like you're proposing something totally different, no? It's not rea

Re: Standard IPC for Python?

2009-01-13 Thread Philip Semanchuk
On Jan 13, 2009, at 3:04 PM, Laszlo Nagy wrote: I was suggesting getting posix_ipc or sysv_ipc to compile against a compatibility library (Cygwin?) under Windows. It sounds like you're proposing something totally different, no? OK I see. But probably I do not want to use Cygwin because t

Re: Standard IPC for Python?

2009-01-13 Thread Aaron Brady
On Jan 13, 2:04 pm, Laszlo Nagy wrote: > - create a wrapper, using ctypes, /windll / cdll/ to access API functions > - use CreateFileMapping on the page file to create shared memory (a la > windows:http://msdn.microsoft.com/en-us/library/aa366537.aspx) > - use CreateEvent/WaitForSingleObject for s

Re: Standard IPC for Python?

2009-01-13 Thread drobi...@gmail.com
On Jan 13, 2:37 pm, Philip Semanchuk wrote: > On Jan 13, 2009, at 2:01 PM, Laszlo Nagy wrote: > > > > >> I realize that lack of Windows support is a big minus for both of   > >> these modules. As I said, any help getting either posix_ipc or   > >> sysv_ipc working under Windows would be much appre

Re: Standard IPC for Python?

2009-01-13 Thread Laszlo Nagy
I was suggesting getting posix_ipc or sysv_ipc to compile against a compatibility library (Cygwin?) under Windows. It sounds like you're proposing something totally different, no? OK I see. But probably I do not want to use Cygwin because that would create another dependency. I understand th

Re: Standard IPC for Python?

2009-01-13 Thread Philip Semanchuk
On Jan 13, 2009, at 2:01 PM, Laszlo Nagy wrote: I realize that lack of Windows support is a big minus for both of these modules. As I said, any help getting either posix_ipc or sysv_ipc working under Windows would be much appreciated. It sounds like you have access to the platform and

Re: Standard IPC for Python?

2009-01-13 Thread Laszlo Nagy
I realize that lack of Windows support is a big minus for both of these modules. As I said, any help getting either posix_ipc or sysv_ipc working under Windows would be much appreciated. It sounds like you have access to the platform and incentive to see it working, so dig in if you like. M

Re: Standard IPC for Python?

2009-01-13 Thread Philip Semanchuk
On Jan 13, 2009, at 1:22 PM, Laszlo Nagy wrote: - posix_ipc is broken under FreeBSD A clarification: the module posix_ipc is *not* broken. It exposes FreeBSD's implementation of POSIX IPC which has broken semaphores (based on my experiments, anyway). The practical result for you is t

Re: Standard IPC for Python?

2009-01-13 Thread Laszlo Nagy
- posix_ipc is broken under FreeBSD A clarification: the module posix_ipc is *not* broken. It exposes FreeBSD's implementation of POSIX IPC which has broken semaphores (based on my experiments, anyway). The practical result for you is the same but the difference is very important to me as

Re: Standard IPC for Python?

2009-01-13 Thread Philip Semanchuk
On Jan 13, 2009, at 12:40 PM, Laszlo Nagy wrote: The only reason to use shm over the sysv_ipc module is that shm supports versions of Python < 2.5. I'm not developing shm any further, so avoid using it if possible. Hmm, we are using FreeBSD, Ubuntu and Windows. Unfortunately - posix_ipc

Re: Standard IPC for Python?

2009-01-13 Thread Laszlo Nagy
I use Pyro. Has always been fast enough for me. It spares you the troubles of bloated XML-documents other RPC-mechanisms use. Of course it is RPC, not "only" IPC - so it comes with a tradeoff. But so far, it has been always fast enough for me. Unfortunately, I'm developing an ORB, and using

  1   2   >