Re: Case-insensitive string equality

2017-08-31 Thread Pete Forman
Steven D'Aprano writes: > Three times in the last week the devs where I work accidentally > introduced bugs into our code because of a mistake with case-insensitive > string comparisons. They managed to demonstrate three different failures: > > # 1 > a = something().upper() # normalise string >

Re: Case-insensitive string equality

2017-08-31 Thread Tim Chase
On 2017-09-01 00:53, MRAB wrote: > What would you expect the result would be for: > >>> "\N{LATIN SMALL LIGATURE FI}".case_insensitive_find("F") 0 >>> "\N{LATIN SMALL LIGATURE FI}".case_insensitive_find("I) 0.5 >>> "\N{LATIN SMALL LIGATURE FFI}".case_insensitive_find("I) 0.6

Re: Case-insensitive string equality

2017-08-31 Thread MRAB
On 2017-08-31 16:29, Tim Chase wrote: On 2017-08-31 07:10, Steven D'Aprano wrote: So I'd like to propose some additions to 3.7 or 3.8. Adding my "yes, a case-insensitive equality-check would be useful" with the following concerns: I'd want to have an optional parameter to take locale into con

Re: pydoc3 in background

2017-08-31 Thread Steve D'Aprano
On Fri, 1 Sep 2017 04:02 am, James wrote: > How to run "pydoc3 -p port" in background? > > TIA > James pydoc3 -p port & -- Steve “Cheer up,” they said, “things could be worse.” So I cheered up, and sure enough, things got worse. -- https://mail.python.org/mailman/listinfo/python-list

Fwd: Your message to linuxCprogramming awaits moderator approval

2017-08-31 Thread Matías Magni
Hi everyone, I'm student of Computer Engineering at Universidad de Mendoza. I'm doing my final thesis project to get my degree and I elaborated a survey destined to web developers. If you're so kind, I would like you could fill it and broadcast it among your social environment. I would be very than

Re: traceback.format_exc() returns 'None\n'?!

2017-08-31 Thread Peter Otten
Sean DiZazzo wrote: > Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 12:39:47) > [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin > Type "help", "copyright", "credits" or "license" for more information. import traceback tb = traceback.format_exc() type(tb) > tb > 'None

Re: Case-insensitive string equality

2017-08-31 Thread Tim Chase
On 2017-08-31 07:10, Steven D'Aprano wrote: > So I'd like to propose some additions to 3.7 or 3.8. Adding my "yes, a case-insensitive equality-check would be useful" with the following concerns: I'd want to have an optional parameter to take locale into consideration. E.g. "i".case_insensitiv

traceback.format_exc() returns 'None\n'?!

2017-08-31 Thread Sean DiZazzo
Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 12:39:47) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import traceback >>> tb = traceback.format_exc() >>> type(tb) >>> tb 'None\n' >>> Shouldn't it just retur

Survey results: How software ecosystems deal with breaking changes

2017-08-31 Thread Chris Bogart
Last fall we announced on this list a survey about how and why breaking changes are handled differently in 18 different software ecosystems. We've just submitted a paper to a conference about the results, and we've also set up a site (http://breakingapis.org/survey) where you can compare how diff

Re: If you are running 32-bit 3.6 on Windows, please test this

2017-08-31 Thread 20/20 Lab
On 08/31/2017 01:53 AM, Pavol Lisy wrote: On 8/31/17, Terry Reedy wrote: On 8/30/2017 1:35 PM, Terry Reedy wrote: https://stackoverflow.com/questions/45965545/math-sqrt-domain-error-when-square-rooting-a-positive-number reports the following: - Microsoft Windows [Version 10.0.16251.10

Re: Case-insensitive string equality

2017-08-31 Thread Pavol Lisy
On 8/31/17, Steve D'Aprano wrote: >> Additionally: a proper "case insensitive comparison" should almost >> certainly start with a Unicode normalization. But should it be NFC/NFD >> or NFKC/NFKD? IMO that's a good reason to leave it in the hands of the >> application. > > Normalisation is orthogo

pydoc3 in background

2017-08-31 Thread James via Python-list
How to run "pydoc3 -p port" in background? TIA James -- https://mail.python.org/mailman/listinfo/python-list

Re: Case-insensitive string equality

2017-08-31 Thread John Gordon
In Serhiy Storchaka writes: > > But when there is a common source of mistakes, we can help prevent > > that mistake. > How can you do this? I know only one way -- teaching and practicing. Modify the environment so that the mistake simply can't happen (or at least happens much less frequently.

Re: Exponential Smoothing program

2017-08-31 Thread Ian Kelly
On Thu, Aug 31, 2017 at 6:35 AM, Ode Idoko via Python-list wrote: > > I am running a master degree programme and very new to programming including > python. I have been given a project to write a python program on exponential > smoothing of some selected stocks. The program should user the user

Re: Case-insensitive string equality

2017-08-31 Thread Tim Chase
On 2017-08-31 18:17, Peter Otten wrote: > A quick and dirty fix would be a naming convention: > > upcase_a = something().upper() I tend to use a "_u" suffix as my convention: something_u = something.upper() which keeps the semantics of the original variable-name while hinting at the normaliza

Re: Exponential Smoothing program

2017-08-31 Thread Rob Gaddi
On 08/31/2017 05:35 AM, Ode Idoko wrote: I am running a master degree programme and very new to programming including python. I have been given a project to write a python program on exponential smoothing of some selected stocks. The program should user the user to input alpha, display the gra

Re: Case-insensitive string equality

2017-08-31 Thread Peter Otten
Steven D'Aprano wrote: > Three times in the last week the devs where I work accidentally > introduced bugs into our code because of a mistake with case-insensitive > string comparisons. They managed to demonstrate three different failures: > > # 1 > a = something().upper() # normalise string > .

Re: Case-insensitive string equality

2017-08-31 Thread Tim Chase
On 2017-08-31 23:30, Chris Angelico wrote: > The method you proposed seems a little odd - it steps through the > strings character by character and casefolds them separately. How is > it superior to the two-line function? And it still doesn't solve any > of your other cases. It also breaks when ca

Re: Case-insensitive string equality

2017-08-31 Thread Rhodri James
On 31/08/17 15:03, Chris Angelico wrote: On Thu, Aug 31, 2017 at 11:53 PM, Stefan Ram wrote: Chris Angelico writes: On Thu, Aug 31, 2017 at 10:49 PM, Steve D'Aprano wrote: On Thu, 31 Aug 2017 05:51 pm, Serhiy Storchaka wrote: 31.08.17 10:10, Steven D'Aprano ???: def equal(s, t): ret

Re: Case-insensitive string equality

2017-08-31 Thread Serhiy Storchaka
31.08.17 17:38, Steve D'Aprano пише: On Thu, 31 Aug 2017 11:45 pm, Serhiy Storchaka wrote: It is not clear what is your problem exactly. That is fair. This is why I am discussing it here first, before taking it to Python-Ideas. At the moment my ideas on the matter are still half-formed. Wha

Re: Case-insensitive string equality

2017-08-31 Thread Steve D'Aprano
On Thu, 31 Aug 2017 11:45 pm, Serhiy Storchaka wrote: > It is not clear what is your problem exactly. That is fair. This is why I am discussing it here first, before taking it to Python-Ideas. At the moment my ideas on the matter are still half-formed. > The easy one-line function > solves th

Re: Case-insensitive string equality

2017-08-31 Thread Chris Angelico
On Fri, Sep 1, 2017 at 12:27 AM, Steve D'Aprano wrote: >> Additionally: a proper "case insensitive comparison" should almost >> certainly start with a Unicode normalization. But should it be NFC/NFD >> or NFKC/NFKD? IMO that's a good reason to leave it in the hands of the >> application. > > Norma

Re: Case-insensitive string equality

2017-08-31 Thread Steve D'Aprano
On Fri, 1 Sep 2017 12:03 am, Chris Angelico wrote: > On Thu, Aug 31, 2017 at 11:53 PM, Stefan Ram wrote: >> Chris Angelico writes: >>>The method you proposed seems a little odd - it steps through the >>>strings character by character and casefolds them separately. How is >>>it superior to the t

Re: Case-insensitive string equality

2017-08-31 Thread Chris Angelico
On Thu, Aug 31, 2017 at 11:53 PM, Stefan Ram wrote: > Chris Angelico writes: >>On Thu, Aug 31, 2017 at 10:49 PM, Steve D'Aprano >> wrote: >>> On Thu, 31 Aug 2017 05:51 pm, Serhiy Storchaka wrote: 31.08.17 10:10, Steven D'Aprano ???: > def equal(s, t): > return s.casefold() == t.

Re: Case-insensitive string equality

2017-08-31 Thread Serhiy Storchaka
31.08.17 15:49, Steve D'Aprano пише: On Thu, 31 Aug 2017 05:51 pm, Serhiy Storchaka wrote: 31.08.17 10:10, Steven D'Aprano пише: (iii) Not every two line function needs to be in the standard library. Just add this to the top of every module: def equal(s, t): return s.casefold() == t.case

Re: Case-insensitive string equality

2017-08-31 Thread Chris Angelico
On Thu, Aug 31, 2017 at 10:49 PM, Steve D'Aprano wrote: > On Thu, 31 Aug 2017 05:51 pm, Serhiy Storchaka wrote: > >> 31.08.17 10:10, Steven D'Aprano пише: >>> (iii) Not every two line function needs to be in the standard library. >>> Just add this to the top of every module: >>> >>> def equal(s, t

Re: Cannot find IDLE

2017-08-31 Thread Terry Reedy
On 8/31/2017 8:46 AM, Yusuf Mohammad wrote: You must provide much more information to get any help. Are you installing on a network or an individual machine? What version of Windows is running, including 32 versus 64 bit? Do you have admin access to the machine? What *exact* python installer are

Re: Case-insensitive string equality

2017-08-31 Thread Steve D'Aprano
On Thu, 31 Aug 2017 05:51 pm, Serhiy Storchaka wrote: > 31.08.17 10:10, Steven D'Aprano пише: >> (iii) Not every two line function needs to be in the standard library. >> Just add this to the top of every module: >> >> def equal(s, t): >> return s.casefold() == t.casefold() > > This is my a

RE: Cannot find IDLE

2017-08-31 Thread Yusuf Mohammad
Wont work unfortunately 31. aug. 2017 13:39 skrev "Bear Light" : > > >How do i install Python in a specific folder with the custom option and be > able to use IDLE? > > After you choose customize install, pick the ”Install for all users” > option then you can change the install location. > > 寄件者:

Exponential Smoothing program

2017-08-31 Thread Ode Idoko via Python-list
I am running a master degree programme and very new to programming including python. I have been given a project to write a python program on exponential smoothing of some selected stocks. The program should user the user to input alpha, display the graph of the original data and "smoothed data

Re: Is there tested Python code for parsing N-Triples?

2017-08-31 Thread Rhodri James
On 31/08/17 13:08, Stefan Ram wrote: David Shi writes: Is there tested Python code for parsing N-Triples? I know of "n-tuples" and of "triples". I think the OP may mean what he said: https://www.w3.org/TR/n-triples/ According to the wiki (https://wiki.python.org/moin/RdfLibraries) there

Re: Is there tested Python code for parsing N-Triples?

2017-08-31 Thread Steve D'Aprano
On Thu, 31 Aug 2017 08:55 pm, David Shi wrote: > Is there tested Python code for parsing N-Triples? What do you mean by N-Triples? Can you give an example? -- Steve “Cheer up,” they said, “things could be worse.” So I cheered up, and sure enough, things got worse. -- https://mail.python.

Re: Case-insensitive string equality

2017-08-31 Thread Rhodri James
On 31/08/17 08:10, Steven D'Aprano wrote: So I'd like to propose some additions to 3.7 or 3.8. If the feedback here is positive, I'll take it to Python-Ideas for the negative feedback :-) (1) Add a new string method, which performs a case-insensitive equality test. Here is a potential implement

RE: Cannot find IDLE

2017-08-31 Thread Bear Light
>How do i install Python in a specific folder with the custom option and be able to use IDLE? After you choose customize install, pick the ”Install for all users” option then you can change the install location. 寄件者: Yusuf Mohammad 傳送時間: 2017年8月31日 下午 04:52 收件者: python-list@python.org 主旨: Canno

Is there tested Python code for parsing N-Triples?

2017-08-31 Thread David Shi via Python-list
Is there tested Python code for parsing N-Triples? Looking forward to hearing from you. Regards, David -- https://mail.python.org/mailman/listinfo/python-list

Re: If you are running 32-bit 3.6 on Windows, please test this

2017-08-31 Thread Pavol Lisy
On 8/31/17, Terry Reedy wrote: > On 8/30/2017 1:35 PM, Terry Reedy wrote: >> https://stackoverflow.com/questions/45965545/math-sqrt-domain-error-when-square-rooting-a-positive-number >> >> >> >> reports the following: >> - >> Microsoft Windows [Version 10.0.16251.1002] >> (c) 2017 Microsoft Co

Cannot find IDLE

2017-08-31 Thread Yusuf Mohammad
Hi! I am trying to send this email again. For some reason when Python is installing it stores in Appdata/Local folder. This is quite weird and when i'm trying to install Python with the custom option to change the location (to Program files (x86)), IDLE is not to be found. I work at a hospital wh

Re: Case Solution: A Dark Horse in the Global Smartphone Market Huawei's Smartphone Strategy by Yangao Xiao, Tony Tong, Guoli Chen, Kathy Wu

2017-08-31 Thread ahmed . gamal . omar . 80
On Saturday, 8 July 2017 05:22:24 UTC+2, Case Solution & Analysis wrote: > Case Solution and Analysis of A Dark Horse in the Global Smartphone Market: > Huawei's Smartphone Strategy by Yangao Xiao, Tony Tong, Guoli Chen, Kathy Wu > is available at a lowest price, send email to > casesolutionsce

Re: If you are running 32-bit 3.6 on Windows, please test this

2017-08-31 Thread Serhiy Storchaka
31.08.17 08:13, Steven D'Aprano пише: As far as I can see, apart from tests for NAN and ±INF, there are no tests of math.sqrt on floats at all. See test_testfile in test_math.py. -- https://mail.python.org/mailman/listinfo/python-list

Re: Case-insensitive string equality

2017-08-31 Thread Serhiy Storchaka
31.08.17 10:10, Steven D'Aprano пише: (iii) Not every two line function needs to be in the standard library. Just add this to the top of every module: def equal(s, t): return s.casefold() == t.casefold() This is my answer. Unsolved problems: This proposal doesn't help with sets and dic

Re: Case-insensitive string equality

2017-08-31 Thread Antoon Pardon
IMO this should be solved by a company used library and I would go in the direction of a Normalized_String class. This has the advantages (1) that the company can choose whatever normalization suits them, not all cases are suited by comparing case insentitively, (2) individual devs in the com

Re: copy locked files

2017-08-31 Thread Steven D'Aprano
On Thu, 31 Aug 2017 00:18:39 -0700, coreylean1 wrote: > On Monday, June 18, 2007 ^^ > No please! I have tried using shadow copy You are replying to a ten year old message. I very much doubt the original poster (or anyone else for that matter) still cares. They're eit

Re: copy locked files

2017-08-31 Thread coreylean1
On Monday, June 18, 2007 at 8:20:24 PM UTC+5:30, rubbis...@web.de wrote: > Hello, > > do you know of any way to copy locked / opened files under win xp? > I know there is something like "Volume Shadow Copy" but I don't know > how to use it. > Maybe someone already has a python solution? > > > Ma

Case-insensitive string equality

2017-08-31 Thread Steven D'Aprano
Three times in the last week the devs where I work accidentally introduced bugs into our code because of a mistake with case-insensitive string comparisons. They managed to demonstrate three different failures: # 1 a = something().upper() # normalise string ... much later on if a == b.lower():

Re: trouble consuming null data from wsdl with suds.client

2017-08-31 Thread dieter
kevinalejandromol...@gmail.com writes: > i was trying to consume the service but i always have the same error, look > over the error message, and i am think that the error is, the suds library > does not support null values on the attributes. > r=client.service.WSOBTENERINTERRUPCIONWEB(1,1)