RE: extend behaviour of assignment operator

2024-01-19 Thread AVI GROSS via Python-list
Guenther, It is best not to suggest a drastic fix for a more limited problem. As a general rule, many programming languages only have a pointer concept even vaguely along the lines you want for garbage collection purposes. An area of memory may have stored alongside it how many other things point

Re: extend behaviour of assignment operator

2024-01-10 Thread Dieter Maurer via Python-list
Guenther Sohler wrote at 2024-1-9 08:14 +0100: >when i run this code > >a = cube([10,1,1]) >b = a > >i'd like to extend the behaviour of the assignment operator >a shall not only contain the cube, but the cube shall also know which >variable name it >was assigned to, lately. I'd like to use that

Re: Extend NTFS with "version" of file and "version" of folder, also optionally GIT integration or something like it.

2018-11-19 Thread skybuck2000
Described also as: (Versioning System Integration with Windows Explorer) Anyway Googling NTFS and GIT turned up this: https://blogs.msdn.microsoft.com/devops/2017/02/03/announcing-gvfs-git-virtual-file-system/ The objective of this project seems to be a bit different. To handle very large pr

Re: Extend NTFS with "version" of file and "version" of folder, also optionally GIT integration or something like it.

2018-11-19 Thread Rhodri James
On 19/11/2018 16:42, [email protected] wrote: As far as I know currently NTFS is missing a key feature for code development and compare: "versioning information" per file and per folder. While I appreciate your desire for Files-11 (the OpenVMS filing system), I'm struggling to see how t

Re: Extend NTFS with "version" of file and "version" of folder, also optionally GIT integration or something like it.

2018-11-19 Thread Ethan Furman
On 11/19/2018 08:42 AM, [email protected] wrote: As far as I know currently NTFS is missing a key feature for code development and compare: "versioning information" per file and per folder. This is not a mailing list for the purpose of discussing Microsoft Windows enhancements. How i

Re: Extend unicodedata with a name/pattern/regex search for character entity references?

2016-09-10 Thread Rustom Mody
On Saturday, September 10, 2016 at 3:56:37 PM UTC+5:30, Veek 'this_is_not_my_name' M wrote: > Veek 'this_is_not_my_name' M wrote: Recursion… Self-Reference…Inversion Heh! On the way to becoming another Gödel/Turing?? You may be interested in this collection of some evidence(s) of recursion bei

Re: Extend unicodedata with a name/pattern/regex search for character entity references?

2016-09-10 Thread Tim Golden
On 10/09/2016 11:26, Veek 'this_is_not_my_name' M wrote: Veek 'this_is_not_my_name' M wrote: /me claps TJG -- https://mail.python.org/mailman/listinfo/python-list

Re: Extend unicodedata with a name/pattern/regex search for character entity references?

2016-09-10 Thread Veek 'this_is_not_my_name' M
Veek 'this_is_not_my_name' M wrote: > Rustom Mody wrote: > >> On Saturday, September 3, 2016 at 5:25:48 PM UTC+5:30, Veek. M wrote: >>> https://mail.python.org/pipermail//python-ideas/2014-October/029630.htm >>> >>> Wanted to know if the above link idea, had been implemented and if >>> there's a

Re: Extend unicodedata with a name/pattern/regex search for character

2016-09-06 Thread jladasky
From: [email protected] On Saturday, September 3, 2016 at 7:49:14 PM UTC-7, Steve D'Aprano wrote: > On Sun, 4 Sep 2016 12:19 pm, Chris Angelico wrote: > > Killfile him and move on... > > But but but... I couldn't do that. > > https://www.xkcd.com/386/ I strongly suspected it would be that particu

Re: Extend unicodedata with a name/pattern/regex search for character

2016-09-06 Thread jladasky
On Saturday, September 3, 2016 at 7:49:14 PM UTC-7, Steve D'Aprano wrote: > On Sun, 4 Sep 2016 12:19 pm, Chris Angelico wrote: > > Killfile him and move on... > > But but but... I couldn't do that. > > https://www.xkcd.com/386/ I strongly suspected it would be that particular XKCD. :^) -- http

Re: Extend unicodedata with a name/pattern/regex search for character entity references?

2016-09-06 Thread jladasky
On Saturday, September 3, 2016 at 7:49:14 PM UTC-7, Steve D'Aprano wrote: > On Sun, 4 Sep 2016 12:19 pm, Chris Angelico wrote: > > Killfile him and move on... > > But but but... I couldn't do that. > > https://www.xkcd.com/386/ I strongly suspected it would be that particular XKCD. :^) -- htt

Re: Extend unicodedata with a name/pattern/regex search for character entity references?

2016-09-06 Thread Veek 'this_is_not_my_name' M
Rustom Mody wrote: > On Saturday, September 3, 2016 at 5:25:48 PM UTC+5:30, Veek. M wrote: >> https://mail.python.org/pipermail//python-ideas/2014-October/029630.htm >> >> Wanted to know if the above link idea, had been implemented and if >> there's a module that accepts a pattern like 'cap' and

Re: Extend unicodedata with a name/pattern/regex search for character entity references?

2016-09-05 Thread Ned Batchelder
On Monday, September 5, 2016 at 2:15:58 AM UTC-4, Thomas 'PointedEars' Lahn wrote: > How can I trust a person > who does not even have the decency and the courage to stand by their > statements with their real name? Feel free to ignore people you don't trust. We'll help them. --Ned. -- https

Re: Extend unicodedata with a name/pattern/regex search for character entity references?

2016-09-05 Thread alister
On Mon, 05 Sep 2016 08:15:42 +0200, Thomas 'PointedEars' Lahn wrote: > >> So Veek should be able to appease P.E. by calling himself 'Veek "David >> Smith" M'. > > That would not help. “Veek” might be (the transcription of) a given > name or a family name, but “Veek M” is not a real name. [Real

Re: Extend unicodedata with a name/pattern/regex search for character entity references?

2016-09-05 Thread Veek. M
Thomas 'PointedEars' Lahn wrote: > Gregory Ewing wrote: > >> Larry Hudson wrote: >>> If you continue to read this forum, you will quickly learn to ignore >>> "Pointy-Ears". He rarely has anything worth while to post, and his >>> unique fetish about Real Names shows him to be a hypocrite as well.

Re: Extend unicodedata with a name/pattern/regex search for character entity references?

2016-09-04 Thread Michael Torrie
On 09/04/2016 04:22 PM, Gregory Ewing wrote: > Larry Hudson wrote: >> If you continue to read this forum, you will quickly learn to ignore >> "Pointy-Ears". He rarely has anything worth while to post, and his >> unique fetish about Real Names shows him to be a hypocrite as well. > > To be fair,

Re: Extend unicodedata with a name/pattern/regex search for character entity references?

2016-09-04 Thread Ned Batchelder
On Sunday, September 4, 2016 at 7:52:44 PM UTC-4, Chris Angelico wrote: > FWIW, hex is much more common for displaying Unicode codepoints than > decimal is. So I'd print it like this (incorporating the 'not CAPITAL' > filter): You are right, I went too quickly, and didn't realize until after I pos

Re: Extend unicodedata with a name/pattern/regex search for character entity references?

2016-09-04 Thread Chris Angelico
On Mon, Sep 5, 2016 at 9:40 AM, Ned Batchelder wrote: > But, 'CAP' appears in 'CAPITAL', which gives more than 1800 matches: > > >>> for c in range(32, 0x11): > ... try: > ... name = unicodedata.name(chr(c)) > ... except ValueError: > ... continue > ... if

Re: Extend unicodedata with a name/pattern/regex search for character entity references?

2016-09-04 Thread Ned Batchelder
On Saturday, September 3, 2016 at 7:55:48 AM UTC-4, Veek. M wrote: > https://mail.python.org/pipermail//python-ideas/2014-October/029630.htm > > Wanted to know if the above link idea, had been implemented and if > there's a module that accepts a pattern like 'cap' and give you all the > instance

Re: Extend unicodedata with a name/pattern/regex search for character entity references?

2016-09-04 Thread Gregory Ewing
Larry Hudson wrote: If you continue to read this forum, you will quickly learn to ignore "Pointy-Ears". He rarely has anything worth while to post, and his unique fetish about Real Names shows him to be a hypocrite as well. To be fair, it's likely that Thomas Lahn is his real name, and he's n

Re: Extend unicodedata with a name/pattern/regex search for character entity references?

2016-09-04 Thread Larry Hudson via Python-list
On 09/04/2016 09:00 AM, Veek. M wrote: Steve D'Aprano wrote: On Sun, 4 Sep 2016 06:53 pm, Thomas 'PointedEars' Lahn wrote: Regarding the name (From field), my name *is* Veek.M […] Liar. *plonk* You have crossed a line now Thomas. That is absolutely uncalled for. You have absolutely no l

Re: Extend unicodedata with a name/pattern/regex search for character entity references?

2016-09-04 Thread Veek. M
Steve D'Aprano wrote: > On Sun, 4 Sep 2016 06:53 pm, Thomas 'PointedEars' Lahn wrote: > >>> Regarding the name (From field), my name *is* Veek.M […] >> >> Liar. *plonk* > > You have crossed a line now Thomas. > > That is absolutely uncalled for. You have absolutely no legitimate > reason to b

Re: Extend unicodedata with a name/pattern/regex search for character entity references?

2016-09-04 Thread Steve D'Aprano
On Sun, 4 Sep 2016 06:53 pm, Thomas 'PointedEars' Lahn wrote: >> Regarding the name (From field), my name *is* Veek.M […] > > Liar. *plonk* You have crossed a line now Thomas. That is absolutely uncalled for. You have absolutely no legitimate reason to believe that Veek is not his or her real

Re: Extend unicodedata with a name/pattern/regex search for character entity references?

2016-09-04 Thread Rustom Mody
On Sunday, September 4, 2016 at 11:18:07 AM UTC+5:30, Rustom Mody wrote: > On Sunday, September 4, 2016 at 9:32:28 AM UTC+5:30, Veek. M wrote: > > Regarding the name (From field), my name *is* Veek.M though I tend to > > shorten it to Vek.M on Google (i think Veek was taken or some such > > thing

Re: Extend unicodedata with a name/pattern/regex search for character entity references?

2016-09-03 Thread Jussi Piitulainen
Chris Angelico writes: > On Sun, Sep 4, 2016 at 12:49 PM, Steve D'Aprano > wrote: >> On Sun, 4 Sep 2016 12:19 pm, Chris Angelico wrote: >> >> [...] Please either comply, or give up your stupid and pointless obsession with trying to be the Internet Police for something that isn't even a

Re: Extend unicodedata with a name/pattern/regex search for character entity references?

2016-09-03 Thread Rustom Mody
On Sunday, September 4, 2016 at 9:32:28 AM UTC+5:30, Veek. M wrote: > Regarding the name (From field), my name *is* Veek.M though I tend to > shorten it to Vek.M on Google (i think Veek was taken or some such > thing). Just to be clear, my parents call me something closely related > to Veek that

Re: Extend unicodedata with a name/pattern/regex search for character entity references?

2016-09-03 Thread Rustom Mody
On Saturday, September 3, 2016 at 5:25:48 PM UTC+5:30, Veek. M wrote: > https://mail.python.org/pipermail//python-ideas/2014-October/029630.htm > > Wanted to know if the above link idea, had been implemented and if > there's a module that accepts a pattern like 'cap' and give you all the > insta

Re: Extend unicodedata with a name/pattern/regex search for character entity references?

2016-09-03 Thread Veek. M
Thomas 'PointedEars' Lahn wrote: > Veek. M wrote: > >> https://mail.python.org/pipermail//python-ideas/2014-October/029630.htm >> >> Wanted to know if the above link idea, > > … which is 404-compliant; the Internet Archive does not have it either > … > >> had been implemented > > Probably not

Re: Extend unicodedata with a name/pattern/regex search for character entity references?

2016-09-03 Thread Chris Angelico
On Sun, Sep 4, 2016 at 12:49 PM, Steve D'Aprano wrote: > On Sun, 4 Sep 2016 12:19 pm, Chris Angelico wrote: > > [...] >>> Please either comply, or give up your stupid and pointless obsession with >>> trying to be the Internet Police for something that isn't even a real >>> rule. >> >> His posts ar

Re: Extend unicodedata with a name/pattern/regex search for character entity references?

2016-09-03 Thread Steve D'Aprano
On Sun, 4 Sep 2016 12:19 pm, Chris Angelico wrote: [...] >> Please either comply, or give up your stupid and pointless obsession with >> trying to be the Internet Police for something that isn't even a real >> rule. > > His posts aren't making it across the news->list gateway any more. > Killfile

Re: Extend unicodedata with a name/pattern/regex search for character entity references?

2016-09-03 Thread Chris Angelico
On Sun, Sep 4, 2016 at 11:51 AM, Steve D'Aprano wrote: > On Sun, 4 Sep 2016 06:47 am, Thomas 'PointedEars' Lahn wrote: > >> Your posting is lacking a real name in the “From” header field. > > > Thomas, if that is really your name, how do we know that: > > Thomas 'PointedEars' Lahn > > is a rea

Re: Extend unicodedata with a name/pattern/regex search for character entity references?

2016-09-03 Thread Steve D'Aprano
On Sun, 4 Sep 2016 06:47 am, Thomas 'PointedEars' Lahn wrote: > Your posting is lacking a real name in the “From” header field. Thomas, if that is really your name, how do we know that: Thomas 'PointedEars' Lahn is a real name? Is sounds made up to me. I'm afraid that we're going to have

Re: extend methods of decimal module

2014-03-01 Thread Mark H. Harris
On Saturday, March 1, 2014 12:55:07 AM UTC-6, Anssi Saari wrote: > I recently watched a presentation by Jessica McKellar of PSF about what > Python needs to stay popular. Other than the obvious bits (difficulties > of limited support of Python on major platforms like Windows and mobile) > the sligh

Re: extend methods of decimal module

2014-02-28 Thread Anssi Saari
Terry Reedy writes: > On 2/27/2014 7:07 AM, Mark H. Harris wrote: > >> Oh, and one more thing... whoever is doing the work on IDLE these >> days, nice job! It is stable, reliable, and just works/ >> appreciate it! > > As one of 'them', thank you for the feedback. There are still some > bugs, bu

Re: extend methods of decimal module

2014-02-28 Thread Mark H. Harris
On Friday, February 28, 2014 1:39:11 PM UTC-6, Mark H. Harris wrote: > On Friday, February 28, 2014 1:34:27 AM UTC-6, Steven D'Aprano wrote: > > > > > Now that Python has a fast C implementation of Decimal, I would be happy > > > for Python 4000 to default to decimal floats, and require specia

Re: extend methods of decimal module

2014-02-28 Thread Mark H. Harris
On Friday, February 28, 2014 1:34:27 AM UTC-6, Steven D'Aprano wrote: > Now that Python has a fast C implementation of Decimal, I would be happy > for Python 4000 to default to decimal floats, and require special syntax > for binary floats. Say, 0.1b if you want a binary float, and 0.1 for a >

Re: extend methods of decimal module

2014-02-28 Thread Mark H. Harris
On Friday, February 28, 2014 12:37:37 PM UTC-6, Chris Angelico wrote: > > Are you aware that IEEE 754 includes specs for decimal floats? :) > Yes. I am from back in the day... way back... so 754 1985 is what I have been referring to. IEEE 854 1987 and the generalized IEEE 754 2008 have

Re: extend methods of decimal module

2014-02-28 Thread Chris Angelico
On Sat, Mar 1, 2014 at 5:34 AM, Mark H. Harris wrote: > Yes. ... and for clarification back to one of my previous comments, when I > refer to 'float' I am speaking of the IEEE binary floating point > representation built-in everywhere... including the processor!... not the > concept of tra

Re: extend methods of decimal module

2014-02-28 Thread Mark H. Harris
On Friday, February 28, 2014 9:11:49 AM UTC-6, Steven D'Aprano wrote: > >> Now that Python has a fast C implementation of Decimal, I would be > >> happy for Python 4000 to default to decimal floats, and require special > >> syntax for binary floats. Say, 0.1b if you want a binary float, and 0.1 >

Re: extend methods of decimal module

2014-02-28 Thread Mark H. Harris
On Friday, February 28, 2014 2:54:12 AM UTC-6, Wolfgang Maier wrote: > Since by now, I guess, we all agree that using the string representation is > the wrong approach, you can simply use Decimal instead of D() throughout > your code. > Best, > Wolfgang hi Wolfgang, ...right... I'm going to

Re: extend methods of decimal module

2014-02-28 Thread Mark H. Harris
On Friday, February 28, 2014 8:41:49 AM UTC-6, Wolfgang Maier wrote: > Hi Mark, > > here is an enhancement for your epx function. > > Wolfgang hi Wolfgang, thanks much! As a matter of point in fact, I ran into this little snag and didn't understand it, because I was thinking that outside o

Re: extend methods of decimal module

2014-02-28 Thread Chris Angelico
On Sat, Mar 1, 2014 at 2:11 AM, Steven D'Aprano wrote: >> or there needs to be a system for constructing literals >> of non-built-in types. And if Decimal becomes built-in, then why that >> and not <>? > > 'Cos we have ten fingers and in count in decimal :-P We talk in words and characters, so we

Re: extend methods of decimal module

2014-02-28 Thread Steven D'Aprano
On Fri, 28 Feb 2014 19:52:45 +1100, Chris Angelico wrote: > On Fri, Feb 28, 2014 at 6:34 PM, Steven D'Aprano > wrote: >> On Fri, 28 Feb 2014 16:00:10 +1100, Chris Angelico wrote: >> >>> If we had some other tag, like 'd', we could actually construct a >>> Decimal straight from the source code. Si

Re: extend methods of decimal module

2014-02-28 Thread Wolfgang
Uhh, the curse of not copy-pasting everything: > >>> exp(20) should, of course, read >>> epx(19) > Traceback (most recent call last): > File "", line 1, in > epx(19) > File "C:\Python34\dmath_rev.py", line 27, in epx > n *= q > decimal.Overflow: [] > -- https://mail.py

Re: extend methods of decimal module

2014-02-28 Thread Wolfgang Maier
Mark H. Harris gmail.com> writes: > > If you get a chance, take a look at the dmath.py code on: > >https://code.google.com/p/pythondecimallibrary/ > Hi Mark, here is an enhancement for your epx function. Your current version comes with the disadvantage of potentially storing extremely l

Re: extend methods of decimal module

2014-02-28 Thread casevh
On Thursday, February 27, 2014 2:33:35 AM UTC-8, Mark H. Harris wrote: > No... was not aware of gmpy2... looks like a great project! I am wondering > why it would be sooo much faster? For multiplication and division of ~1000 decimal digit numbers, gmpy2 is ~10x faster. The numbers I gave were f

Re: extend methods of decimal module

2014-02-28 Thread Wolfgang Maier
Mark H. Harris gmail.com> writes: > > On Thursday, February 27, 2014 10:26:59 PM UTC-6, Chris Angelico wrote: > > > Create Decimal values from strings, not from the str() of a float, > > which first rounds in binary and then rounds in decimal. > > > > Thanks Chris... another excellent point.

Re: extend methods of decimal module

2014-02-28 Thread Chris Angelico
On Fri, Feb 28, 2014 at 6:34 PM, Steven D'Aprano wrote: > On Fri, 28 Feb 2014 16:00:10 +1100, Chris Angelico wrote: > >> If we had some other tag, like 'd', we could actually construct a >> Decimal straight from the source code. Since source code is a string, >> it'll be constructed from that stri

Re: extend methods of decimal module

2014-02-27 Thread Steven D'Aprano
On Fri, 28 Feb 2014 16:00:10 +1100, Chris Angelico wrote: > If we had some other tag, like 'd', we could actually construct a > Decimal straight from the source code. Since source code is a string, > it'll be constructed from that string, and it'll never go via float. Now that Python has a fast C

Re: extend methods of decimal module

2014-02-27 Thread Chris Angelico
On Fri, Feb 28, 2014 at 4:18 PM, Mark H. Harris wrote: > do I make the assumption that all functions will take a string as argument > and then let interactive users bare the responsibility to enter a string or > decimal... avoiding floats... Just have your users pass in Decimal objects. They ca

Re: extend methods of decimal module

2014-02-27 Thread Mark H. Harris
On Thursday, February 27, 2014 10:26:59 PM UTC-6, Chris Angelico wrote: > Create Decimal values from strings, not from the str() of a float, > which first rounds in binary and then rounds in decimal. > Thanks Chris... another excellent point... ok, you guys have about convinced me (which is sp

Re: extend methods of decimal module

2014-02-27 Thread Chris Angelico
On Fri, Feb 28, 2014 at 3:41 PM, Mark H. Harris wrote: > So, I am thinking I need to mods... maybe an idmath.py for interactive > sessions, and then dmath.py for for running within my scientific scripts... > ?? No; the solution is to put quotes around your literals in interactive mode, too.

Re: extend methods of decimal module

2014-02-27 Thread Mark H. Harris
On Thursday, February 27, 2014 9:15:36 PM UTC-6, Steven D'Aprano wrote: > Decimal uses base 10, so it is a better fit for numbers we > write out in base 10 like "0.12345", but otherwise it suffers from the > same sort of floating point rounding issues as floats do. > > > py> Decimal('1.2345'

Re: extend methods of decimal module

2014-02-27 Thread Chris Angelico
On Fri, Feb 28, 2014 at 1:15 PM, Mark H. Harris wrote: > Its just easier to type D(2.78) than Deciaml('2.78'). It's easier to type 2.78 than 2.718281828, too, but one of them is just plain wrong. Would you tolerate using 2.78 for e because it's easier to type? I mean, it's gonna be close. Creat

Re: extend methods of decimal module

2014-02-27 Thread Steven D'Aprano
On Thu, 27 Feb 2014 15:00:45 -0800, Mark H. Harris wrote: > Decimal does not keep 0.1 as a floating point format (regardless of > size) which is why banking can use Decimal without having to worry about > the floating formatting issue... in other words, 0.0 is not stored in > Decimal as any k

Re: extend methods of decimal module

2014-02-27 Thread Mark H. Harris
On Thursday, February 27, 2014 5:50:55 PM UTC-6, Oscar Benjamin wrote: > . . . Calling Decimal on a float performs an exact binary to > decimal conversion. Your reasoning essentially assumes that every > float should be interpreted as an approximate representation for a > nearby decimal value.

Re: extend methods of decimal module

2014-02-27 Thread Oscar Benjamin
On 27 February 2014 23:00, Mark H. Harris wrote: > On Thursday, February 27, 2014 10:24:23 AM UTC-6, Oscar Benjamin wrote: > > from decimal import Decimal as D >> >>> D(0.1) >> Decimal('0.155511151231257827021181583404541015625') > > hi Oscar, well, that's not what I'm doing

Re: extend methods of decimal module

2014-02-27 Thread Wolfgang
On Friday, February 28, 2014 12:00:45 AM UTC+1, Mark H. Harris wrote: > On Thursday, February 27, 2014 10:24:23 AM UTC-6, Oscar Benjamin wrote: > from decimal import Decimal as D > > > >>> D(0.1) > > > Decimal('0.155511151231257827021181583404541015625') > > > > hi Oscar,

Re: extend methods of decimal module

2014-02-27 Thread Mark H. Harris
On Thursday, February 27, 2014 10:24:23 AM UTC-6, Oscar Benjamin wrote: from decimal import Decimal as D > >>> D(0.1) > Decimal('0.155511151231257827021181583404541015625') > hi Oscar, well, that's not what I'm doing with my D()... I'm not just making D() mimic Decimal.

Re: extend methods of decimal module

2014-02-27 Thread Chris Angelico
On Fri, Feb 28, 2014 at 4:07 AM, Terry Reedy wrote: > On 2/27/2014 7:07 AM, Mark H. Harris wrote: > >> Oh, and one more thing... whoever is doing the work on IDLE these >> days, nice job! It is stable, reliable, and just works/ >> appreciate it! > > > As one of 'them', thank you for the feedback

Re: extend methods of decimal module

2014-02-27 Thread Terry Reedy
On 2/27/2014 7:07 AM, Mark H. Harris wrote: Oh, and one more thing... whoever is doing the work on IDLE these days, nice job! It is stable, reliable, and just works/ appreciate it! As one of 'them', thank you for the feedback. There are still some bugs, but I hit them seldom enough that I a

Re: extend methods of decimal module

2014-02-27 Thread Oscar Benjamin
On 27 February 2014 15:42, Mark H. Harris wrote: > On Thursday, February 27, 2014 8:42:55 AM UTC-6, Oscar Benjamin wrote: > >> >> Some points: > >Thanks so much... you have clarified some things I was struggling with... > >> 1) Why have you committed the code as a .tar.gz file? > > um, to

Re: extend methods of decimal module

2014-02-27 Thread Chris Angelico
On Fri, Feb 28, 2014 at 2:42 AM, Mark H. Harris wrote: >> 1) Why have you committed the code as a .tar.gz file? > > um, to save space... well, I know its tiny, but its just a habit I > have... 5kb instead of 25kb... When you commit changes, though, it has to treat it as a completely changed

Re: extend methods of decimal module

2014-02-27 Thread Mark H. Harris
On Thursday, February 27, 2014 8:42:55 AM UTC-6, Oscar Benjamin wrote: > > Some points: Thanks so much... you have clarified some things I was struggling with... > 1) Why have you committed the code as a .tar.gz file? um, to save space... well, I know its tiny, but its just a habit I ha

Re: extend methods of decimal module

2014-02-27 Thread Oscar Benjamin
On 27 February 2014 12:07, Mark H. Harris wrote: > > I have created a project here: > > https://code.google.com/p/pythondecimallibrary/ > > I wrote a dmath.py library module for use with the C accelerated decimal > module, that I would like to see merged into the C Python distribution so > that

Re: extend methods of decimal module

2014-02-27 Thread Mark H. Harris
On Wednesday, February 19, 2014 4:10:22 PM UTC-6, Terry Reedy wrote: > Or just dmath. I think this is a better idea than suggesting additions > to decimal itself. For one thing, anything put in decimal would be > subject to change if the function were to be added to the standard. It > is worth

Re: extend methods of decimal module

2014-02-27 Thread Mark H. Harris
On Wednesday, February 19, 2014 4:29:27 PM UTC-6, Oscar Benjamin wrote: > Actually the performance difference isn't as big as you might think. > > Oscar You're right. At least my own benchmark on my native exp() vs the built-in was about ~same ~same. I was hoping that Stefan had used FFT...

Re: extend methods of decimal module

2014-02-27 Thread Mark H. Harris
> > Have you looked at the gmpy2 ( https://code.google.com/p/gmpy/ ) module? > > casevh No... was not aware of gmpy2... looks like a great project! I am wondering why it would be sooo much faster? I was hoping that Stefan Krah's C accelerator was using FFT fast fourier transforms for mul

Re: extend methods of decimal module

2014-02-19 Thread casevh
On Wednesday, February 19, 2014 1:30:13 PM UTC-8, Mark H. Harris wrote: > > I guess what I'm really asking for are the same routines found in "bc -l" > math library. I've finally moved my number crunching stuff to python (from > bc) because the performance of "decimal" is finally way better than b

Re: extend methods of decimal module

2014-02-19 Thread Oscar Benjamin
On 19 February 2014 15:30, Mark H. Harris wrote: > Would it be possible to extend the methods of the decimal module just a bit > to include atan(), sin(), cos(), and exp() ? > > The module has methods for ln() and sqrt(); and that's great! > > I have done some rudimentary searching of the pep his

Re: extend methods of decimal module

2014-02-19 Thread Zachary Ware
On Wed, Feb 19, 2014 at 4:10 PM, Terry Reedy wrote: > On 2/19/2014 4:54 PM, Zachary Ware wrote: >> You might consider suggesting a "decimal.math" module on python-ideas. > > > Or just dmath. The name (and location) is of course endlessly bikesheddable :) > I think this is a better idea than sugg

Re: extend methods of decimal module

2014-02-19 Thread Terry Reedy
On 2/19/2014 4:54 PM, Zachary Ware wrote: On Wed, Feb 19, 2014 at 3:30 PM, Mark H. Harris wrote: The decimal module implements IEEE 854 Thanks Terry... ... long time. I would like to find out if there is some iron-clad policy about extending the implementation of an IEEE standard... deci

Re: extend methods of decimal module

2014-02-19 Thread Zachary Ware
On Wed, Feb 19, 2014 at 3:30 PM, Mark H. Harris wrote: >> >> The decimal module implements IEEE 854 >> > > Thanks Terry... ... long time. > > I would like to find out if there is some iron-clad policy about extending > the implementation of an IEEE standard... decimal module in this case; I'm >

Re: extend methods of decimal module

2014-02-19 Thread Mark H. Harris
> > The decimal module implements IEEE 854 > Thanks Terry... ... long time. I would like to find out if there is some iron-clad policy about extending the implementation of an IEEE standard... decimal module in this case; I'm just thinking that this particular extension really fits the pyt

Re: extend methods of decimal module

2014-02-19 Thread Terry Reedy
On 2/19/2014 10:30 AM, Mark H. Harris wrote: Would it be possible to extend the methods of the decimal module just a bit to include atan(), sin(), cos(), and exp() ? The decimal module implements IEEE 854 The module has methods for ln() and sqrt(); and that's great! that includes just these

Re: extend class: include factories functions inside constructor

2011-08-18 Thread aspineux
On Aug 18, 4:45 pm, Peter Otten <[email protected]> wrote: > aspineux wrote: > > Hi > > I have a closed class and 2 factories function > > > class Data: > >   def __init__(self): > >     self.payload=None > > > def data_from_string(payload): > >   data=Data() > >   data.payload=payload > >   return

Re: extend class: include factories functions inside constructor

2011-08-18 Thread aspineux
On Aug 18, 4:45 pm, Peter Otten <[email protected]> wrote: > aspineux wrote: > > Hi > > I have a closed class and 2 factories function > > > class Data: > >   def __init__(self): > >     self.payload=None > > > def data_from_string(payload): > >   data=Data() > >   data.payload=payload > >   return

Re: extend class: include factories functions inside constructor

2011-08-18 Thread Peter Otten
aspineux wrote: > Hi > I have a closed class and 2 factories function > > class Data: > def __init__(self): > self.payload=None > > def data_from_string(payload): > data=Data() > data.payload=payload > return data > > def data_from_file(f): > data=Data() > data.payload=f.read()

Re: extend getattr()

2008-06-27 Thread Jared Grubb
You could overload __getattr__ (might have to play around a bit to make sure any possible AttributeError's look right, but the basic idea is here) class A(object): # ... def __getattr__(self, name): try: return object.__getattribute__(self, name) except AttributeError:

Re: extend getattr()

2008-06-26 Thread George Sakkis
On Jun 26, 7:39 am, Cédric Lucantis <[EMAIL PROTECTED]> wrote: > Le Thursday 26 June 2008 13:06:53 Rotlaus, vous avez écrit : > > > Hello, > > > lets assume i have some classes: > > > class A(object): > > def __init__(self): > > b = B() > > > class B(object): > > def __init__(self)

Re: extend getattr()

2008-06-26 Thread Cédric Lucantis
Le Thursday 26 June 2008 13:06:53 Rotlaus, vous avez écrit : > Hello, > > lets assume i have some classes: > > class A(object): > def __init__(self): > b = B() > > class B(object): > def __init__(self): > c = C() > note you're just defining some local variables here, should

Re: extend getattr()

2008-06-26 Thread Gerhard Häring
Rotlaus wrote: Hello, lets assume i have some classes: [...] a=A() c=getattr(a, 'b.c') I know this doesn't work, but what can i do to get this or a similar functionality to get it work for this sample and for even more nested classes? Just recursively apply the getattr(), like this: class A

Re: Extend file type

2006-09-26 Thread Sybren Stuvel
abcd enlightened us with: > Any suggestions on how to find out? I did try adding to MyFile > > def __call__(self, *args): > print "calling:", args > return file.__call__(self, *args) > > but I never see that either. I don't know the answer to your problem, but I can explain why this d

Re: Extend file type

2006-09-26 Thread Fredrik Lundh
abcd wrote: > Any ideas what methods the stdout (and I guess stderr) of Popen objects > from subprocess call? the external process only sees OS-level file handles (the number you get from the fileno() method on your file objects), not Python objects. no matter how you override things in your p

Re: extend

2005-11-14 Thread Chris Mellon
On 11/14/05, Ben Bush <[EMAIL PROTECTED]> wrote: > is there any python code doing this: > there are two line segments (2x+y-1=0 with the coordinates of two ending > points are (1,-1) and (-1,3); > x+y+6=0 with the coordinates of two ending points are (-3,-3) and > (-4,-2);). They extend and when th

Re: Extend Python

2005-09-03 Thread Jorgen Grahn
On Thu, 1 Sep 2005 19:09:55 +0200, Filip Dreger <[EMAIL PROTECTED]> wrote: >> My Question: >> Swig offers some great features but is to basic for us. Is there >> another program that creates more readble code that can be easily >> edited? How much work is it to write our own wrappers? > > Not too m

Re: Extend Python

2005-09-01 Thread Filip Dreger
> My Question: > Swig offers some great features but is to basic for us. Is there > another program that creates more readble code that can be easily > edited? How much work is it to write our own wrappers? Not too much, and practicaly not at all if you want to wrap procedures (not objects or typ

Re: Extend Python

2005-09-01 Thread Jake Gittes
Try looking at ctypes - http://starship.python.net/crew/theller/ctypes/ On 1 Sep 2005 05:12:21 -0700, [EMAIL PROTECTED] wrote: >Hi All I have a problem with extentions of Python. > >Background: >I'm workin within a large industrial control system and I have created >a Port for VxWorks. In the sys

Re: Extend Python

2005-09-01 Thread Ravi Teja
SIP is not a commercial product and is released on a different license than PyQt. >From the SIP docs (http://www.river-bank.demon.co.uk/docs/sip/sipref.html#license) 1.1 License SIP is licensed under the same terms as Python itself. SIP places no restrictions on the license you may apply to the

Re: Extend Python

2005-09-01 Thread Tommy . Ryding
What is Qt? I have looked at PyQT and I can´t use it. I haven't tried it but the PyQT license makes the program useless. :( Any other suggestions? -- http://mail.python.org/mailman/listinfo/python-list

Re: Extend Python

2005-09-01 Thread tooper
PyQT is using SIP to wrap Qt : looks nice and works great for PyQt which is a quite big wrapping. Never had the occation to use it myself however, except for this. -- http://mail.python.org/mailman/listinfo/python-list

Re: extend for loop syntax with if expr like listcomp&genexp ?

2005-07-14 Thread Paul Rubin
Terry Hancock <[EMAIL PROTECTED]> writes: > But of course that's not equivalent. It's hard to imagine a > use case for an enumerated loop when the object being > iterated over is anonymous (will be lost as soon as the loop exits). Huh? Not at all. print 'List of Python fans:' for i,x in enu

Re: extend for loop syntax with if expr like listcomp&genexp ?

2005-07-12 Thread Bengt Richter
On Tue, 12 Jul 2005 23:07:07 -0500, Terry Hancock <[EMAIL PROTECTED]> wrote: >On Monday 11 July 2005 08:53 pm, Bengt Richter wrote: >> On Tue, 12 Jul 2005 10:12:33 +1000, John Machin <[EMAIL PROTECTED]> wrote: >> >Bengt Richter wrote: >> >> for x in (x for x in seq if x is not None): >> >Byzan

Re: extend for loop syntax with if expr like listcomp&genexp ?

2005-07-12 Thread Terry Hancock
On Monday 11 July 2005 08:53 pm, Bengt Richter wrote: > On Tue, 12 Jul 2005 10:12:33 +1000, John Machin <[EMAIL PROTECTED]> wrote: > >Bengt Richter wrote: > >> for x in (x for x in seq if x is not None): > >Byzantine ... > Perhaps not if you wanted to enumerate the selected elements, as in >

Re: extend for loop syntax with if expr like listcomp&genexp ?

2005-07-11 Thread Bengt Richter
On Tue, 12 Jul 2005 10:12:33 +1000, John Machin <[EMAIL PROTECTED]> wrote: >Bengt Richter wrote: >> E.g., so we could write >> >> for x in seq if x is not None: > >Chundrous; looks like that p**l language ... ^--piqued my interest, where'd that come from? ;-) > >> print repr

Re: extend for loop syntax with if expr like listcomp&genexp ?

2005-07-11 Thread Ron Adam
Bengt Richter wrote: > E.g., so we could write > > for x in seq if x is not None: > print repr(x), "isn't None ;-)" > > instead of > > for x in (x for x in seq if x is not None): > print repr(x), "isn't None ;-)" > > just a thought. > > Regards, > Bengt Richter Is it n

Re: extend for loop syntax with if expr like listcomp&genexp ?

2005-07-11 Thread John Machin
Bengt Richter wrote: > E.g., so we could write > > for x in seq if x is not None: Chundrous; looks like that p**l language ... > print repr(x), "isn't None ;-)" > > instead of > > for x in (x for x in seq if x is not None): Byzantine ... > print repr(x), "isn't None ;