Re: A few questiosn about encoding

2013-06-13 Thread jmfauth
-- UTF-8, Unicode (consortium): 1 to 4 *Unicode Transformation Unit* UTF-8, ISO 10646: 1 to 6 *Unicode Transformation Unit* (still actual, unless tealy freshly modified) jmf -- http://mail.python.org/mailman/listinfo/python-list

Re: Changing filenames from Greeklish = Greek (subprocess complain)

2013-06-10 Thread jmfauth
- A coding scheme works with three sets. A *unique* set of CHARACTERS, a *unique* set of CODE POINTS and a *unique* set of ENCODED CODE POINTS, unicode or not. The relation between the set of characters and the set of the code points is a *human* table, created with a sheet of paper and a

Re: Changing filenames from Greeklish = Greek (subprocess complain)

2013-06-05 Thread jmfauth
On 5 juin, 19:43, Νικόλαος Κούρας nikos.gr...@gmail.com wrote: Ôç ÔåôÜñôç, 5 Éïõíßïõ 2013 8:56:36 ð.ì. UTC+3, ï ÷ñÞóôçò Steven D'Aprano Ýãñáøå: Somehow, I don't know how because I didn't see it happen, you have one or more files in that directory where the file name as bytes is invalid when

Re: PyWart: The problem with print

2013-06-04 Thread jmfauth
On 2 juin, 20:09, Rick Johnson rantingrickjohn...@gmail.com wrote: I never purposely inject ANY superfluous cycles in my code except in the case of testing or development. To me it's about professionalism. Let's consider a thought exercise shall we? The flexible string

Re: python b'...' notation

2013-05-31 Thread jmfauth
On 31 mai, 00:19, alcyon st...@terrafirma.us wrote: On Wednesday, May 29, 2013 3:19:42 PM UTC-7, Cameron Simpson wrote: On 29May2013 13:14, Ian Kelly ian.g.ke...@gmail.com wrote: | On Wed, May 29, 2013 at 12:33 PM, alcyon st...@terrafirma.us wrote: | This notation displays hex values

Re: How to get an integer from a sequence of bytes

2013-05-30 Thread jmfauth
On 30 mai, 20:42, Ian Kelly ian.g.ke...@gmail.com wrote: On Thu, May 30, 2013 at 12:26 PM, Mok-Kong Shen mok-kong.s...@t-online.de wrote: Am 27.05.2013 17:30, schrieb Ned Batchelder: On 5/27/2013 10:45 AM, Mok-Kong Shen wrote: From an int one can use to_bytes to get its individual

Re: Harmonic distortion of a input signal

2013-05-23 Thread jmfauth
On 20 mai, 19:56, Christian Gollwitzer aurio...@gmx.de wrote: Oops, I thought we were posting to comp.dsp. Nevertheless, I think numpy.fft does mixed-radix (can't check it now) Am 20.05.13 19:50, schrieb Christian Gollwitzer: Am 20.05.13 19:23, schrieb jmfauth: Non sense. Dito

Re: Harmonic distortion of a input signal

2013-05-20 Thread jmfauth
Non sense. The discrete fft algorithm is valid only if the number of data points you transform does correspond to a power of 2 (2**n). Keywords to the problem: apodization, zero filling, convolution product, ... eg. http://en.wikipedia.org/wiki/Convolution jmf --

Re: Diacretical incensitive search

2013-05-17 Thread jmfauth
The handling of diacriticals is especially a nice case study. One can use it to toy with some specific features of Unicode, normalisation, decomposition, ... ... and also to show how Unicode can be badly implemented. First and quick example that came to my mind (Py325 and Py332):

Re: PDF generator decision

2013-05-14 Thread jmfauth
On 14 mai, 17:05, Christian Jurk co...@commx.ws wrote: Hi folks, This questions may be asked several times already, but the development of relevant software continues day-for-day. For some time now I've been using xhtml2pdf [1] to generate PDF documents from HTML templates (which are

Re: Unicode humor

2013-05-10 Thread jmfauth
On 8 mai, 15:19, Roy Smith r...@panix.com wrote: Apropos to any of the myriad unicode threads that have been going on recently: http://xkcd.com/1209/ -- This reflects a lack of understanding of Unicode. jmf -- http://mail.python.org/mailman/listinfo/python-list

Re: Why do Perl programmers make more money than Python programmers

2013-05-07 Thread jmfauth
On 6 mai, 09:49, Fábio Santos fabiosantos...@gmail.com wrote: On 6 May 2013 08:34, Chris Angelico ros...@gmail.com wrote: Well you see, it was 70 bytes back in the Python 2 days (I'll defer to Steven for data points earlier than that), but with Python 3, there were two versions: one was

Is Unicode support so hard...

2013-04-20 Thread jmfauth
In a previous post, http://groups.google.com/group/comp.lang.python/browse_thread/thread/6aec70817705c226# , Chris “Kwpolska” Warrick wrote: “Is Unicode support so hard, especially in the 21st century?” -- Unicode is not really complicate and it works very well (more than two decades of

Re: While loop help

2013-04-09 Thread jmfauth
On 9 avr, 15:32, thomasancill...@gmail.com wrote: I'm new to learning python and creating a basic program to convert units of measurement which I will eventually expand upon but im trying to figure out how to loop the entire program. When I insert a while loop it only loops the first 2

Re: In defence of 80-char lines

2013-04-04 Thread jmfauth
On 4 avr, 03:36, Steven D'Aprano steve +comp.lang.pyt...@pearwood.info wrote: Although PEP 8 is only compulsory for the Python standard library, many users like to stick to PEP 8 for external projects. http://www.python.org/dev/peps/pep-0008/ With perhaps one glaring exception: many people

Re: Performance of int/long in Python 3

2013-04-03 Thread jmfauth
This FSR is wrong by design. A naive way to embrace Unicode. jmf -- http://mail.python.org/mailman/listinfo/python-list

Re: Performance of int/long in Python 3

2013-04-02 Thread jmfauth
On 2 avr, 01:43, Neil Hodgson nhodg...@iinet.net.au wrote: Mark Lawrence: You've given many examples of the same type of micro benchmark, not many examples of different types of benchmark.     Trying to work out what jmfauth is on about I found what appears to be a performance regression

Re: Performance of int/long in Python 3

2013-04-02 Thread jmfauth
On 2 avr, 10:03, Chris Angelico ros...@gmail.com wrote: On Tue, Apr 2, 2013 at 6:24 PM, jmfauth wxjmfa...@gmail.com wrote: An editor may reflect very well the example a gave. You enter thousand ascii chars, then - boum - as you enter a non ascii char, your editor (assuming is uses

Re: Performance of int/long in Python 3

2013-04-02 Thread jmfauth
On 2 avr, 10:35, Steven D'Aprano steve +comp.lang.pyt...@pearwood.info wrote: On Tue, 02 Apr 2013 19:03:17 +1100, Chris Angelico wrote: So what? Who cares if it takes 0.2 second to insert a character instead of 0.1 second? That's still a hundred times faster than you can type.

Re: Performance of int/long in Python 3

2013-04-02 Thread jmfauth
On 2 avr, 16:03, Steven D'Aprano steve +comp.lang.pyt...@pearwood.info wrote: On Tue, 02 Apr 2013 11:58:11 +0100, Steve Simmons wrote: I'm sure you didn't intend to be insulting, but some of us *have* taken JMF seriously, at least at first. His repeated overblown claims of how Python is

Re: Performance of int/long in Python 3

2013-04-02 Thread jmfauth
On 2 avr, 18:57, rusi rustompm...@gmail.com wrote: On Apr 2, 8:17 pm, Ethan Furman et...@stoneleaf.us wrote: Simmons (too many Steves!), I know you're new so don't have all the history with jmf that many of us do, but consider that the original post was about numbers, had nothing to do

Re: Performance of int/long in Python 3

2013-04-01 Thread jmfauth
- I'm not whining or and I'm not complaining (and never did). I always exposed facts. I'm not especially interested in Python, I'm interested in Unicode. Usualy when I posted examples, there are confirmed. What I see is this (std download-abled Python's on Windows 7 (and other

Re: Performance of int/long in Python 3

2013-04-01 Thread jmfauth
On 1 avr, 21:28, Chris Angelico ros...@gmail.com wrote: On Tue, Apr 2, 2013 at 6:15 AM, jmfauth wxjmfa...@gmail.com wrote: Py32 import timeit timeit.repeat('a' * 1000 + 'ẞ') [0.7005365263669056, 0.6810694766790423, 0.6811978680727229] timeit.repeat('a' * 1000 + 'z

Re: flaming vs accuracy [was Re: Performance of int/long in Python 3]

2013-03-31 Thread jmfauth
-- Neil Hodgson: The counter-problem is that a French document that needs to include one mathematical symbol (or emoji) outside Latin-1 will double in size as a Python string. Serious developers/typographers/users know that you can not compose a text in French with latin-1. This is now also

Re: flaming vs accuracy [was Re: Performance of int/long in Python 3]

2013-03-28 Thread jmfauth
On 28 mar, 07:12, Ethan Furman et...@stoneleaf.us wrote: On 03/27/2013 08:49 PM, rusi wrote: In particular You are a liar is as bad as You are an idiot The same statement can be made non-abusively thus: ... is not true because ... I don't agree.  With all the posts and micro benchmarks

Re: flaming vs accuracy [was Re: Performance of int/long in Python 3]

2013-03-28 Thread jmfauth
On 28 mar, 11:30, Chris Angelico ros...@gmail.com wrote: On Thu, Mar 28, 2013 at 8:03 PM, jmfauth wxjmfa...@gmail.com wrote: - You really REALLY need to sort out in your head the difference between correctness and performance. I still haven't seen one single piece of evidence from you

Re: flaming vs accuracy [was Re: Performance of int/long in Python 3]

2013-03-28 Thread jmfauth
On 28 mar, 14:01, Steven D'Aprano steve +comp.lang.pyt...@pearwood.info wrote: On Thu, 28 Mar 2013 23:11:55 +1100, Neil Hodgson wrote: Ian Foote: One benefit of UTF-8 over Python's flexible representation is that it is, on average, more compact over a wide set of samples. Sure. And

Re: flaming vs accuracy [was Re: Performance of int/long in Python 3]

2013-03-28 Thread jmfauth
On 28 mar, 15:38, Chris Angelico ros...@gmail.com wrote: On Fri, Mar 29, 2013 at 1:12 AM, jmfauth wxjmfa...@gmail.com wrote: This flexible string representation is so absurd that not only it does not know you can not write Western European Languages with latin-1, it penalizes you by just

Re: flaming vs accuracy [was Re: Performance of int/long in Python 3]

2013-03-28 Thread jmfauth
On 28 mar, 16:14, jmfauth wxjmfa...@gmail.com wrote: On 28 mar, 15:38, Chris Angelico ros...@gmail.com wrote: On Fri, Mar 29, 2013 at 1:12 AM, jmfauth wxjmfa...@gmail.com wrote: This flexible string representation is so absurd that not only it does not know you can not write

Re: flaming vs accuracy [was Re: Performance of int/long in Python 3]

2013-03-28 Thread jmfauth
Chris, Your problem with int/long, the start of this thread, is very intersting. This is not a demonstration, a proof, rather an illustration. Assume you have a set of integers {0...9} and an operator, let say, the addition. Idea. Just devide this set in two chunks, {0...4} and {5...9} and

Re: flaming vs accuracy [was Re: Performance of int/long in Python 3]

2013-03-28 Thread jmfauth
On 28 mar, 17:33, Ian Kelly ian.g.ke...@gmail.com wrote: On Thu, Mar 28, 2013 at 7:34 AM, jmfauth wxjmfa...@gmail.com wrote: The flexible string representation takes the problem from the other side, it attempts to work with the characters by using their representations and it (can only

Re: flaming vs accuracy [was Re: Performance of int/long in Python 3]

2013-03-28 Thread jmfauth
On 28 mar, 18:55, Chris Angelico ros...@gmail.com wrote: On Fri, Mar 29, 2013 at 4:48 AM, jmfauth wxjmfa...@gmail.com wrote: If Python had imlemented Unicode correctly, there would be no difference in using an a, é, € or any character, what the narrow builds did. I'm not following your

Re: flaming vs accuracy [was Re: Performance of int/long in Python 3]

2013-03-28 Thread jmfauth
On 28 mar, 21:29, Benjamin Kaplan benjamin.kap...@case.edu wrote: On Thu, Mar 28, 2013 at 10:48 AM, jmfauth wxjmfa...@gmail.com wrote: On 28 mar, 17:33, Ian Kelly ian.g.ke...@gmail.com wrote: On Thu, Mar 28, 2013 at 7:34 AM, jmfauth wxjmfa...@gmail.com wrote: The flexible string

Re: flaming vs accuracy [was Re: Performance of int/long in Python 3]

2013-03-28 Thread jmfauth
On 28 mar, 22:11, jmfauth wxjmfa...@gmail.com wrote: On 28 mar, 21:29, Benjamin Kaplan benjamin.kap...@case.edu wrote: On Thu, Mar 28, 2013 at 10:48 AM, jmfauth wxjmfa...@gmail.com wrote: On 28 mar, 17:33, Ian Kelly ian.g.ke...@gmail.com wrote: On Thu, Mar 28, 2013 at 7:34 AM

Re: Performance of int/long in Python 3

2013-03-27 Thread jmfauth
On 26 mar, 22:08, Grant Edwards inva...@invalid.invalid wrote: I think we all agree that jmf is a character. -- The characters are also intrisic characteristics of a group in the Group Theory. If you are not a mathematician, but eg a scientist in need of these characters, they are

Re: Performance of int/long in Python 3

2013-03-26 Thread jmfauth
On 25 mar, 22:51, Chris Angelico ros...@gmail.com wrote: The Python 3 merge of int and long has effectively penalized small-number arithmetic by removing an optimization. As we've seen from PEP 393 strings (jmf aside), there can be huge benefits from having a single type with multiple

Re: Performance of int/long in Python 3

2013-03-26 Thread jmfauth
On 26 mar, 20:03, Chris Angelico ros...@gmail.com wrote: On Wed, Mar 27, 2013 at 5:50 AM, jmfauth wxjmfa...@gmail.com wrote: On 25 mar, 22:51, Chris Angelico ros...@gmail.com wrote: The Python 3 merge of int and long has effectively penalized small-number arithmetic by removing

Re: monty python

2013-03-24 Thread jmfauth
On 23 mar, 17:17, Mark Lawrence breamore...@yahoo.co.uk wrote: On 23/03/2013 09:24, jmfauth wrote: On 20 mar, 22:02, Tim Delaney tim.dela...@aptare.com wrote: On 21 March 2013 06:40, jmfauth wxjmfa...@gmail.com wrote: [snip usual rant from jmf] It has been acknowledged

Re: monty python

2013-03-23 Thread jmfauth
On 20 mar, 22:02, Tim Delaney tim.dela...@aptare.com wrote: On 21 March 2013 06:40, jmfauth wxjmfa...@gmail.com wrote: [snip usual rant from jmf] It has been acknowledged as a real regression, but he keeps hijacking every thread where strings are mentioned to harp on about it. He

Re: monty python

2013-03-23 Thread jmfauth
On 21 mar, 04:12, rusi rustompm...@gmail.com wrote: On Mar 21, 12:40 am, jmfauth wxjmfa...@gmail.com wrote: Courageous people can try to do something with the unicode collation algorithm (see unicode.org). Some time ago, for the fun, I wrote something (not perfect) with a reduced

Re: Help. HOW TO guide for PyQt installation

2013-03-21 Thread jmfauth
On 20 mar, 11:38, Phil Thompson p...@riverbankcomputing.com wrote: On Wed, 20 Mar 2013 03:29:35 -0700 (PDT), jmfauth wxjmfa...@gmail.com wrote: On 20 mar, 10:30, Phil Thompson p...@riverbankcomputing.com wrote: On Wed, 20 Mar 2013 02:09:06 -0700 (PDT), jmfauth wxjmfa...@gmail.com

Re: Help. HOW TO guide for PyQt installation

2013-03-21 Thread jmfauth
On 20 mar, 11:29, jmfauth wxjmfa...@gmail.com wrote: On 20 mar, 10:30, Phil Thompson p...@riverbankcomputing.com wrote: - Strangely, I had not problem (if I recall correctly) with a very basic application (QMainWindow + QLineEdit). ADDENDUM, CORRECTION It fails too. I forgot to rename

Re: Help. HOW TO guide for PyQt installation

2013-03-20 Thread jmfauth
On 20 mar, 01:12, D. Xenakis gouzouna...@hotmail.com wrote: Hi there, Im searching for an installation guide for PyQt toolkit. To be honest im very confused about what steps should i follow for a complete and clean installation. Should i better choose to install the 32bit or the 64bit

Re: Help. HOW TO guide for PyQt installation

2013-03-20 Thread jmfauth
On 20 mar, 10:30, Phil Thompson p...@riverbankcomputing.com wrote: On Wed, 20 Mar 2013 02:09:06 -0700 (PDT), jmfauth wxjmfa...@gmail.com wrote: On 20 mar, 01:12, D. Xenakis gouzouna...@hotmail.com wrote: Hi there, Im searching for an installation guide for PyQt toolkit

Re: monty python

2013-03-20 Thread jmfauth
Courageous people can try to do something with the unicode collation algorithm (see unicode.org). Some time ago, for the fun, I wrote something (not perfect) with a reduced keys table (see unicode.org), only a keys subset for some scripts hold in memory. It works with Py32 and Py33. In an

Re: String performance regression from python 3.2 to 3.3

2013-03-16 Thread jmfauth
-- utf-32 is already here. You are all most probably [*] using it without noticing it. How? By using OpenType fonts, without counting the text processing applications using them. Why? Because there is no other way to do it. [*] depending of the font, the internal table(s), eg cmap table, are

A reply for rusi (FSR)

2013-03-13 Thread jmfauth
As a reply to rusi's comment: http://groups.google.com/group/comp.lang.python/browse_thread/thread/a7689b158fdca29e# From string creation to the itertools usage. A medley. Some timings. Important: The real/absolute values of these experiments are not important. I do not care and I'm not

Re: Regular expression problem

2013-03-11 Thread jmfauth
On 11 mar, 03:06, Terry Reedy tjre...@udel.edu wrote: ... By teaching 'speed before correctness, this site promotes bad programming habits and thinking (and the use of low-level but faster languages). ... This is exactly what your flexible string representation does! And away from

Re: Controlling number of zeros of exponent in scientific notation

2013-03-06 Thread jmfauth
On 6 mar, 15:03, Roy Smith r...@panix.com wrote: In article c2184b42-41be-4930-9501-361296df7...@googlegroups.com,  fa...@squashclub.org wrote: Instead of: 1.8e-04 I need: 1.8e-004 So two zeros before the 4, instead of the default 1. Just out of curiosity, what's the use case

Re: Nuitka now supports Python 3.2

2013-02-27 Thread jmfauth
Fascinating software. Some are building, some are destroying. Py33 timeit.repeat({1:'abc需'}) [0.2573893570572636, 0.24261832285651508, 0.24259548003601594] Py323 timeit.repeat({1:'abc需'}) [0.11000708521282831, 0.0994753634273593, 0.09901023634051853] jmf --

Re: Nuitka now supports Python 3.2

2013-02-27 Thread jmfauth
On 27 fév, 09:21, jmfauth wxjmfa...@gmail.com wrote: Fascinating software. Some are building, some are destroying. Py33 timeit.repeat({1:'abc需'}) [0.2573893570572636, 0.24261832285651508, 0.24259548003601594] Py323 timeit.repeat({1:'abc需'}) [0.11000708521282831

Re: Python Speed

2013-02-27 Thread jmfauth
On 27 fév, 23:24, Terry Reedy tjre...@udel.edu wrote: On 2/27/2013 3:21 AM, jmfauth hijacked yet another thread:   Some are building, some are destroying. We are still waiting for you to help build a better 3.3+, instead of trying to 'destroy' it with mostly irrelevant cherry-picked

Re: Correct handling of case in unicode and regexps

2013-02-24 Thread jmfauth
On 23 fév, 15:26, Devin Jeanpierre jeanpierr...@gmail.com wrote: Hi folks, I'm pretty unsure of myself when it comes to unicode. As I understand it, you're generally supposed to compare things in a case insensitive manner by case folding, right? So instead of a.lower() == b.lower() (the

Re: Python Newbie

2013-02-23 Thread jmfauth
On 23 fév, 16:43, Steve Simmons square.st...@gmail.com wrote: On 22/02/2013 22:37, piterrr.dolin...@gmail.com wrote: So far I am getting the impression ... My main message to you would be :  don't approach Python with a negative attitude, give it a chance and I'm sure you'll come to enjoy

Re: Python Newbie

2013-02-23 Thread jmfauth
On 23 fév, 20:08, Ethan Furman et...@stoneleaf.us wrote: On 02/23/2013 10:44 AM, jmfauth wrote: [snip various stupidities] jmf Peter, jmfauth is one of our resident trolls.  Feel free to ignore him. -- ~Ethan~ Sorry, what can say? More memory and slow down! If you see a progress, I'm

Re: string.replace doesn't removes :

2013-02-14 Thread jmfauth
On 13 fév, 21:24, 8 Dihedral dihedral88...@googlemail.com wrote: Rick Johnson於 2013年2月14日星期四UTC+8上午12時34分11秒寫道: On Wednesday, February 13, 2013 1:10:14 AM UTC-6, jmfauth wrote: d = {ord('a'): 'A', ord('b'): '2', ord('c'): 'C'} 'abcdefgabc'.translate(d) 'A2CdefgA2C

Re: string.replace doesn't removes :

2013-02-12 Thread jmfauth
On 13 fév, 06:26, Rick Johnson rantingrickjohn...@gmail.com wrote: On Tuesday, February 12, 2013 10:44:09 PM UTC-6, Rick Johnson wrote:  REFERENCES: [1]: Should

Re: Curious to see alternate approach on a search/replace via regex

2013-02-07 Thread jmfauth
On 7 fév, 04:04, Steven D'Aprano steve +comp.lang.pyt...@pearwood.info wrote: On Wed, 06 Feb 2013 13:55:58 -0800, Demian Brecht wrote: Well, an alternative /could/ be: ... py s = 'http://alongnameofasite1234567.com/q?sports=runa=1b=1' py assert u2f(s) == mangle(s) py py from timeit import

Re: Py3.3 unicode literal and input()

2012-06-25 Thread jmfauth
Mea culpa. I had not my head on my shoulders. Inputing if working fine, it returns text correctly. However, and this is something different, I'm a little bit surprised, input() does not handle escaped characters (\u, \U). Workaround: encode() and decode() as raw-unicode-escape. jmf --

Re: Py3.3 unicode literal and input()

2012-06-20 Thread jmfauth
On Jun 20, 1:21 am, Steven D'Aprano steve +comp.lang.pyt...@pearwood.info wrote: On Mon, 18 Jun 2012 07:00:01 -0700, jmfauth wrote: On 18 juin, 12:11, Steven D'Aprano steve +comp.lang.pyt...@pearwood.info wrote: On Mon, 18 Jun 2012 02:30:50 -0700, jmfauth wrote: On 18 juin, 10:28

Re: Py3.3 unicode literal and input()

2012-06-20 Thread jmfauth
On Jun 20, 11:22 am, Christian Heimes li...@cheimes.de wrote: Am 18.06.2012 20:45, schrieb Terry Reedy: The simultaneous reintroduction of 'ur', but with a different meaning than in 2.7, *was* a problem and it should be removed in the next release.

Re: Python equivalent to the A or a output conversions in C

2012-06-19 Thread jmfauth
On Jun 19, 9:54 pm, Edward C. Jones edcjo...@comcast.net wrote: On 06/19/2012 12:41 PM, Hemanth H.M wrote: float.hex(x) '0x1.5p+3' Some days I don't ask the brightest questions.  Suppose x was a numpy floating scalar (types numpy.float16, numpy.float32, numpy.float64, or

Py3.3 unicode literal and input()

2012-06-18 Thread jmfauth
What is input() supposed to return? u'a' == 'a' True r1 = input(':') :a r2 = input(':') :u'a' r1 == r2 False type(r1), len(r1) (class 'str', 1) type(r2), len(r2) (class 'str', 4) --- sys.argv? jmf -- http://mail.python.org/mailman/listinfo/python-list

Re: Py3.3 unicode literal and input()

2012-06-18 Thread jmfauth
On 18 juin, 10:28, Benjamin Kaplan benjamin.kap...@case.edu wrote: On Mon, Jun 18, 2012 at 1:19 AM, jmfauth wxjmfa...@gmail.com wrote: What is input() supposed to return? u'a' == 'a' True r1 = input(':') :a r2 = input(':') :u'a' r1 == r2 False type(r1), len(r1) (class 'str

Re: Py3.3 unicode literal and input()

2012-06-18 Thread jmfauth
On 18 juin, 12:11, Steven D'Aprano steve +comp.lang.pyt...@pearwood.info wrote: On Mon, 18 Jun 2012 02:30:50 -0700, jmfauth wrote: On 18 juin, 10:28, Benjamin Kaplan benjamin.kap...@case.edu wrote: The u prefix is only there to make it easier to port a codebase from Python 2 to Python 3

Re: Py3.3 unicode literal and input()

2012-06-18 Thread jmfauth
Thinks are very clear to me. I wrote enough interactive interpreters with all available toolkits for Windows since I know Python (v. 1.5.6). I do not see why the semantic may vary differently in code source or in an interactive interpreter, esp. if Python allow it! If you have to know by advance

Re: Py3.3 unicode literal and input()

2012-06-18 Thread jmfauth
We are turning in circles. You are somehow legitimating the reintroduction of unicode literals and I shew, not to say proofed, it may be a source of problems. Typical Python desease. Introduce a problem, then discuss how to solve it, but surely and definitivly do not remove that problem. As far

Re: Py3.3 unicode literal and input()

2012-06-18 Thread jmfauth
On Jun 18, 8:45 pm, Terry Reedy tjre...@udel.edu wrote: On 6/18/2012 12:39 PM, jmfauth wrote: We are turning in circles. You are, not we. Please stop. You are somehow legitimating the reintroduction of unicode literals We are not 'reintroducing' unicode literals. In Python 3, string

Re: Python 3.3.0a4, please add ru'...'

2012-06-17 Thread jmfauth
On 17 juin, 13:30, Christian Heimes li...@cheimes.de wrote: Am 16.06.2012 19:36, schrieb jmfauth: Please consistency. Python 3.3 supports the ur syntax just as Python 2.x: $ ./python Python 3.3.0a4+ (default:4c704dc97496, Jun 16 2012, 00:06:09) [GCC 4.6.3] on linux Type help, copyright

Re: Python 3.3.0a4, please add ru'...'

2012-06-17 Thread jmfauth
On 17 juin, 15:48, Christian Heimes li...@cheimes.de wrote: Am 17.06.2012 14:11, schrieb jmfauth: I noticed this at the 3.3.0a0 realease. The main motivation for this came from this: http://bugs.python.org/issue13748 PS I saw the dev-list message. PS2 Opinion, if not really useful

Python 3.3.0a4, please add ru'...'

2012-06-16 Thread jmfauth
Please consistency. sys.version '3.3.0a4 (v3.3.0a4:7c51388a3aa7+, May 31 2012, 20:15:21) [MSC v.1600 32 bit (Intel)]' 'a' 'a' b'a' b'a' br'a' b'a' rb'a' b'a' u'a' 'a' ur'a' 'a' ru'a' SyntaxError: invalid syntax jmf -- http://mail.python.org/mailman/listinfo/python-list

Re: python3 raw strings and \u escapes

2012-05-30 Thread jmfauth
On 30 mai, 13:54, Thomas Rachel nutznetz-0c1b6768-bfa9-48d5- a470-7603bd3aa...@spamschutz.glglgl.de wrote: Am 30.05.2012 08:52 schrieb ru...@yahoo.com: This breaks a lot of my code because in python 2        re.split (ur'[\u3000]', u'A\u3000A') ==  [u'A', u'A'] but in python 3 (the

Re: python3 raw strings and \u escapes

2012-05-30 Thread jmfauth
On 30 mai, 08:52, ru...@yahoo.com ru...@yahoo.com wrote: In python2, \u escapes are processed in raw unicode strings.  That is, ur'\u3000' is a string of length 1 consisting of the IDEOGRAPHIC SPACE unicode character. In python3, \u escapes are not processed in raw strings. r'\u3000' is a

Re: str.isnumeric and Cuneiforms

2012-05-18 Thread jmfauth
On 17 mai, 21:32, Marco marc...@nsgmail.com wrote: Is it normal the str.isnumeric() returns False for these Cuneiforms? '\U00012456' '\U00012457' '\U00012432' '\U00012433' They are all in the Nl category. Indeed there are, but Unicode (ver. 5.0.0) does not assign numeric values to these

Re: str.isnumeric and Cuneiforms

2012-05-18 Thread jmfauth
On 18 mai, 17:08, Marco Buttu name.surn...@gmail.com wrote: On 05/17/2012 09:32 PM, Marco wrote: Is it normal the str.isnumeric() returns False for these Cuneiforms? '\U00012456' '\U00012457' '\U00012432' '\U00012433' They are all in the Nl category. Marco It's ok, I found

Re: str.isnumeric and Cuneiforms

2012-05-18 Thread jmfauth
On 18 mai, 17:08, Marco Buttu name.surn...@gmail.com wrote: On 05/17/2012 09:32 PM, Marco wrote: Is it normal the str.isnumeric() returns False for these Cuneiforms? '\U00012456' '\U00012457' '\U00012432' '\U00012433' They are all in the Nl category. Marco It's ok, I found

Re: Difference between str.isdigit() and str.isdecimal() in Python 3

2012-05-16 Thread jmfauth
On 16 mai, 17:48, Marco marc...@nsgmail.com wrote: Hi all, because There should be one-- and preferably only one --obvious way to do it, there should be a difference between the two methods in the subject, but I can't find it:   '123'.isdecimal(), '123'.isdigit() (True, True)  

On u'Unicode string literals' (Py3)

2012-02-29 Thread jmfauth
For those who do not know: The u'' string literal trick has never worked in Python 2. sys.version '2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)]' print u'Un oeuf à zéro EURO uro' Un uf à zéro uro jmf -- http://mail.python.org/mailman/listinfo/python-list

Re: On u'Unicode string literals' reintroduction (Py3)

2012-02-29 Thread jmfauth
On 29 fév, 14:45, jmfauth wxjmfa...@gmail.com wrote: For those who do not know: The u'' string literal trick has never worked in Python 2. sys.version '2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)]' print u'Un oeuf à zéro EURO uro' Un  uf à zéro  uro jmf Sorry

Re: Python math is off by .000000000000045

2012-02-26 Thread jmfauth
On 25 fév, 23:51, Steven D'Aprano steve +comp.lang.pyt...@pearwood.info wrote: On Sat, 25 Feb 2012 13:25:37 -0800, jmfauth wrote: (2.0).hex() '0x1.0p+1' (4.0).hex() '0x1.0p+2' (1.5).hex() '0x1.8p+0' (1.1).hex() '0x1.1999ap+0' jmf

Re: Python math is off by .000000000000045

2012-02-25 Thread jmfauth
(2.0).hex() '0x1.0p+1' (4.0).hex() '0x1.0p+2' (1.5).hex() '0x1.8p+0' (1.1).hex() '0x1.1999ap+0' jmf -- http://mail.python.org/mailman/listinfo/python-list

Re: distutils bdist_wininst failure on Linux

2012-02-23 Thread jmfauth
On 23 fév, 15:06, Steven D'Aprano steve +comp.lang.pyt...@pearwood.info wrote: Following instructions here: http://docs.python.org/py3k/distutils/builtdist.html#creating-windows... I am trying to create a Windows installer for a pure-module distribution using Python 3.2. I get a LookupError:

Re: format a measurement result and its error in scientific way

2012-02-17 Thread jmfauth
On 16 fév, 01:18, Daniel Fetchinson fetchin...@googlemail.com wrote: Hi folks, often times in science one expresses a value (say 1.03789291) and its error (say 0.00089) in a short way by parentheses like so: 1.0379(9) Before swallowing any Python solution, you should realize, the values

Re: format a measurement result and its error in scientific way

2012-02-17 Thread jmfauth
On 17 fév, 11:03, Daniel Fetchinson fetchin...@googlemail.com wrote: Hi folks, often times in science one expresses a value (say 1.03789291) and its error (say 0.00089) in a short way by parentheses like so: 1.0379(9) Before swallowing any Python solution, you should realize, the values

Re: Python usage numbers

2012-02-14 Thread jmfauth
On 13 fév, 04:09, Terry Reedy tjre...@udel.edu wrote: * The new internal unicode scheme for 3.3 is pretty much a mixture of the 3 storage formats (I am of course, skipping some details) by using the widest one needed for each string. The advantage is avoiding problems with each of the three.

Re: Python usage numbers

2012-02-12 Thread jmfauth
There is so much to say on the subject, I do not know where to start. Some points. Today, Sunday, 12 February 2012, 90%, if not more, of the Python applications supposed to work with text and I'm toying with are simply not working. Two reasons: 1) Most of the devs understand nothing or not

Re: changing sys.path

2012-02-02 Thread jmfauth
On 2 fév, 11:03, Andrea Crotti andrea.crott...@gmail.com wrote: On 02/02/2012 12:51 AM, Steven D'Aprano wrote: On Wed, 01 Feb 2012 17:47:22 +, Andrea Crotti wrote: Yes they are exactly the same, because in that file I just write exactly the same list, but when modifying it at

Re: changing sys.path

2012-02-01 Thread jmfauth
On 1 fév, 17:15, Andrea Crotti andrea.crott...@gmail.com wrote: So suppose I want to modify the sys.path on the fly before running some code which imports from one of the modules added. at run time I do sys.path.extend(paths_to_add) but it still doesn't work and I get an import error. If

Re: sys.argv as a list of bytes

2012-01-19 Thread jmfauth
In short: if you need to write system scripts on Unix, and you need them to work reliably, you need to stick with Python 2.x. I think, understanding the coding of the characters helps a bit. I can not figure out how the example below could not be done on other systems. D:\tmpchcp Page de

Re: NaN, Null, and Sorting

2012-01-13 Thread jmfauth
On 13 jan, 20:04, Ethan Furman et...@stoneleaf.us wrote: With NaN, it is possible to get a list that will not properly sort: -- NaN = float('nan') -- spam = [1, 2, NaN, 3, NaN, 4, 5, 7, NaN] -- sorted(spam) [1, 2, nan, 3, nan, 4, 5, 7, nan] I'm constructing a Null object with the semantics

Re: UnicodeEncodeError in compile

2012-01-11 Thread jmfauth
On 11 jan, 01:56, Terry Reedy tjre...@udel.edu wrote: On 1/10/2012 8:43 AM, jmfauth wrote: D:\c:\python32\python.exe Python 3.2.2 (default, Sep  4 2011, 09:51:08) [MSC v.1500 32 bit (Intel)] on win 32 Type help, copyright, credits or license for more information. '\u5de5'.encode

Re: UnicodeEncodeError in compile

2012-01-11 Thread jmfauth
On 11 jan, 01:56, Terry Reedy tjre...@udel.edu wrote: On 1/10/2012 8:43 AM, jmfauth wrote: ... mbcs encodes according to the current codepage. Only the chinese codepage(s) can encode the chinese char. So the unicode error is correct and 2.7 has a bug in that it is doing errors='replace

Re: UnicodeEncodeError in compile

2012-01-10 Thread jmfauth
1) If I copy/paste these CJK chars from Google Groups in two of my interactive interpreters (no dos/cmd console), I have no problem. import unicodedata as ud ud.name('工') 'CJK UNIFIED IDEOGRAPH-5DE5' ud.name('具') 'CJK UNIFIED IDEOGRAPH-5177' hex(ord(('工'))) '0x5de5' hex(ord('具')) '0x5177'

Re: UnicodeEncodeError in compile

2012-01-10 Thread jmfauth
On 10 jan, 11:53, 8 Dihedral dihedral88...@googlemail.com wrote: Terry Reedy於 2012年1月10日星期二UTC+8下午4時08分40秒寫道: I get the same error running 3.2.2 under IDLE but not when pasting into Command Prompt. However, Command Prompt may be cheating by replacing the Chinese chars with '??' upon

Re: UnicodeEncodeError in compile

2012-01-10 Thread jmfauth
On 10 jan, 13:28, jmfauth wxjmfa...@gmail.com wrote: Addendum, Python console (dos box) D:\c:\python32\python.exe Python 3.2.2 (default, Sep 4 2011, 09:51:08) [MSC v.1500 32 bit (Intel)] on win 32 Type help, copyright, credits or license for more information. '\u5de5'.encode('utf-8') b'\xe5

Re: How to support a non-standard encoding?

2012-01-06 Thread jmfauth
On 6 jan, 11:03, Ivan i...@llaisdy.com wrote: Dear All I'm developing a python application for which I need to support a non-standard character encoding (specifically ISO 6937/2-1983, Addendum 1-1989).  Here are some of the properties of the encoding and its use in the application:    - I

Re: Python 2 or 3

2011-12-03 Thread jmfauth
On 3 déc, 04:54, Antti J Ylikoski antti.yliko...@tkk.fi wrote: Helsinki, Finland, the EU sys.version '2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)]' 'éléphant' '\xe9l\xe9phant' sys.version '3.2.2 (default, Sep 4 2011, 09:51:08) [MSC v.1500 32 bit (Intel)]'

Re: encoding problem with BeautifulSoup - problem when writing parsed text to file

2011-10-06 Thread jmfauth
On 6 oct, 06:39, Greg gregor.hochsch...@googlemail.com wrote: Brilliant! It worked. Thanks! Here is the final code for those who are struggling with similar problems: ## open and decode file # In this case, the encoding comes from the charset argument in a meta tag # e.g. meta

Re: How do I automate the removal of all non-ascii characters from my code?

2011-09-13 Thread jmfauth
On 12 sep, 23:39, Rhodri James rho...@wildebst.demon.co.uk wrote: Now read what Steven wrote again.  The issue is that the program contains   characters that are syntactically illegal.  The engine can be perfectly   correctly translating a character as a smart quote or a non breaking space  

Re: How do I automate the removal of all non-ascii characters from my code?

2011-09-13 Thread jmfauth
On 13 sep, 10:15, Steven D'Aprano steve +comp.lang.pyt...@pearwood.info wrote: The intrinsic coding of the characters is one thing, The usage of bytes stream supposed to represent a text is one another thing, jmf -- http://mail.python.org/mailman/listinfo/python-list

  1   2   >