Re: same code to login,one is ok,another is not

2011-08-15 Thread Rafael Durán Castañeda
First one is using http and second one https, did you try an https handler? as I already pointed out to you in other thread with the same topic... Please don't spam the list, if you aren 't getting the answers you was looking for, wait for a while and then repost not just open threads until get

Re: allow line break at operators

2011-08-15 Thread Terry Reedy
On 8/15/2011 12:28 AM, Seebs wrote: To repeat again: you are free to put in explicit dedent markers that will let you re-indent code should all indents be removed. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Help needed with using SWIG wrapped code in Python

2011-08-15 Thread Vipul Raheja
Hi, I have wrapped a library from C++ to Python using SWIG. But I am facing problems while importing and using it in Python. $ python import pyossimtest import pyossim a = [Image1.png,Image2.png] b = pyossimtest.Info() b.initialize(len(a),a) Traceback (most recent call last): File stdin,

Re: allow line break at operators

2011-08-15 Thread Chris Angelico
On Mon, Aug 15, 2011 at 5:28 AM, Seebs usenet-nos...@seebs.net wrote: Character stream:  tab tab tab foo newline tab bar.  This is, as you say, *usually* two dedents, but it could be one. I see your point, though I cannot imagine anyone who would use tab tab as an indent level. But if you go

Re: pythonw.exe

2011-08-15 Thread Chris Angelico
On Mon, Aug 15, 2011 at 3:14 AM, Dennis Lee Bieber wlfr...@ix.netcom.com wrote:        Depends... DOS, to me, is just short for Disk Operating System... I've source code (in a book) for K2FDOS, source code for LS-DOS 6, and have used the AmigaDOS component of AmigaOS (granted -- AmigaDOS

Re: allow line break at operators

2011-08-15 Thread Paul Woolcock
On Aug 14, 2011 3:24 PM, Seebs usenet-nos...@seebs.net wrote: ... I'm not impressed by arguments based on but if I do something stupid, like select text with my eyes closed and reindent it without looking, I expect the compiler to save my bacon. In my opinion, it's not the compiler's job

surprising interaction between function scope and class namespace

2011-08-15 Thread Stefan Behnel
Hi, I just stumbled over this: A = 1 def foo(x): ... A = x ... class X: ... a = A ... return X ... foo(2).a 2 def foo(x): ... A = x ... class X: ... A = A ... return X ... foo(2).A 1 Works that way in Py2.7 and

Re: surprising interaction between function scope and class namespace

2011-08-15 Thread Stefan Behnel
Stefan Behnel, 15.08.2011 11:33: I just stumbled over this: A = 1 def foo(x): ... A = x ... class X: ... a = A ... return X ... foo(2).a 2 def foo(x): ... A = x ... class X: ... A = A ... return X ... foo(2).A 1 Works that way in

Re: Help needed with using SWIG wrapped code in Python

2011-08-15 Thread Stefan Behnel
Vipul Raheja, 15.08.2011 10:08: I have wrapped a library from C++ to Python using SWIG. But I am facing problems while importing and using it in Python. $ python import pyossimtest import pyossim a = [Image1.png,Image2.png] b = pyossimtest.Info() b.initialize(len(a),a) Traceback (most

Re: surprising interaction between function scope and class namespace

2011-08-15 Thread Duncan Booth
Stefan Behnel stefan...@behnel.de wrote: I couldn't find any documentation on this, but my *guess* about the reasoning is that the second case contains an assignment to A inside of the class namespace, and assignments make a variable local to a scope, in this case, the function scope.

Re: surprising interaction between function scope and class namespace

2011-08-15 Thread Peter Otten
Stefan Behnel wrote: Hi, I just stumbled over this: A = 1 def foo(x): ... A = x ... class X: ... a = A ... return X ... foo(2).a 2 def foo(x): ... A = x ... class X: ... A = A ... return X

Re: allow line break at operators

2011-08-15 Thread Tim Chase
On 08/14/2011 11:28 PM, Seebs wrote: I tend to write stuff like foo.array_of_things.sort.map { block }.join(, ) I like this a lot more than array = foo.array_of_things sorted_array = array.sort() mapped_array = [block(x) for x in sorted_array] ,

Re: Ten rules to becoming a Python community member.

2011-08-15 Thread Neil Cerutti
On 2011-08-14, Chris Angelico ros...@gmail.com wrote: On Sun, Aug 14, 2011 at 2:21 PM, Irmen de Jong irmen.nos...@xs4all.nl wrote: On 14-8-2011 7:57, rantingrick wrote: 8. Use e.g. as many times as you can! (e.g. e.g.) If you use e.g. more than ten times in a single post, you will get an

Re: Help needed with using SWIG wrapped code in Python

2011-08-15 Thread Philip Semanchuk
On Aug 15, 2011, at 4:08 AM, Vipul Raheja wrote: Hi, I have wrapped a library from C++ to Python using SWIG. But I am facing problems while importing and using it in Python. Hi Vipul, Did you try asking about this on the SWIG mailing list? bye Philip --

Re: allow line break at operators

2011-08-15 Thread Johann Hibschman
Chris Angelico ros...@gmail.com writes: Why is left-to-right inherently more logical than multiplication-before-addition? Why is it more logical than right-to-left? And why is changing people's expectations more logical than fulfilling them? Python uses the + and - symbols to mean addition

Re: allow line break at operators

2011-08-15 Thread Steven D'Aprano
Seebs wrote: I tend to write stuff like foo.array_of_things.sort.map { block }.join(, ) I like this a lot more than array = foo.array_of_things sorted_array = array.sort() mapped_array = [block(x) for x in sorted_array] , .join(mapped_array) If you insist on a one-liner for four

Re: allow line break at operators

2011-08-15 Thread Roy Smith
In article mailman.2233.1313179799.1164.python-l...@python.org, Chris Angelico ros...@gmail.com wrote: Python uses the + and - symbols to mean addition and subtraction for good reason. Let's not alienate the mathematical mind by violating this rule. Computer programming languages follow math

Re: allow line break at operators

2011-08-15 Thread Chris Angelico
On Mon, Aug 15, 2011 at 2:41 PM, Roy Smith r...@panix.com wrote: Demand, no, but sometimes it's a good idea.  I've been writing computer programs for close to 40 years, and I still have no clue what most of the order of operations is.  It's just not worth investing the brain cells to remember

Re: allow line break at operators

2011-08-15 Thread Steven D'Aprano
Roy Smith wrote: Computer programming languages follow math conventions only in the most vague ways.  For example, standard math usage dictates that addition is commutative.  While this is true for adding integers, it's certainly not true for adding strings (in any language which supports

Re: allow line break at operators

2011-08-15 Thread Chris Angelico
On Mon, Aug 15, 2011 at 3:28 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: And of course, once you start using floating point numbers, you can't assume commutativity: 0.1 + 0.7 + 0.3 == 0.3 + 0.7 + 0.1 False This isn't because programming languages fail to follow

string to unicode

2011-08-15 Thread Artie Ziff
if I am using the standard csv library to read contents of a csv file which contains Unicode strings (short example: '\xe8\x9f\x92\xe8\x9b\x87'), how do I use a python Unicode method such as decode or encode to transform this string type into a python unicode type? Must I know the encoding

Re: string to unicode

2011-08-15 Thread Chris Angelico
On Mon, Aug 15, 2011 at 4:20 PM, Artie Ziff artie.z...@gmail.com wrote: if I am using the standard csv library to read contents of a csv file which contains Unicode strings (short example: '\xe8\x9f\x92\xe8\x9b\x87'), how do I use a python Unicode method such as decode or encode to transform

Re: string to unicode

2011-08-15 Thread Adam Tauno Williams
On Mon, 2011-08-15 at 08:20 -0700, Artie Ziff wrote: if I am using the standard csv library to read contents of a csv file which contains Unicode strings (short example: '\xe8\x9f\x92\xe8\x9b\x87'), how do I use a python Unicode method such as decode or encode to transform this string type

Re: Ten rules to becoming a Python community member.

2011-08-15 Thread Lucio Santi
On Mon, Aug 15, 2011 at 9:06 AM, Neil Cerutti ne...@norwich.edu wrote: On 2011-08-14, Chris Angelico ros...@gmail.com wrote: On Sun, Aug 14, 2011 at 2:21 PM, Irmen de Jong irmen.nos...@xs4all.nl wrote: On 14-8-2011 7:57, rantingrick wrote: 8. Use e.g. as many times as you can! (e.g. e.g.)

Re: Java is killing me! (AKA: Java for Pythonheads?)

2011-08-15 Thread Dirk Olmes
On Fri, 12 Aug 2011 17:02:38 +, kj wrote: *Please* forgive me for asking a Java question in a Python forum. My only excuse for this no-no is that a Python forum is more likely than a Java one to have among its readers those who have had to deal with the same problems I'm wrestling with.

Re: allow line break at operators

2011-08-15 Thread Seebs
On 2011-08-15, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: Seebs wrote: I tend to write stuff like foo.array_of_things.sort.map { block }.join(, ) I like this a lot more than array = foo.array_of_things sorted_array = array.sort() mapped_array = [block(x) for x in

Re: allow line break at operators

2011-08-15 Thread Seebs
On 2011-08-15, Roy Smith r...@panix.com wrote: Demand, no, but sometimes it's a good idea. I've been writing computer programs for close to 40 years, and I still have no clue what most of the order of operations is. It's just not worth investing the brain cells to remember such trivia

Re: Ten rules to becoming a Python community member.

2011-08-15 Thread MRAB
On 15/08/2011 17:18, Lucio Santi wrote: On Mon, Aug 15, 2011 at 9:06 AM, Neil Cerutti ne...@norwich.edu mailto:ne...@norwich.edu wrote: On 2011-08-14, Chris Angelico ros...@gmail.com mailto:ros...@gmail.com wrote: On Sun, Aug 14, 2011 at 2:21 PM, Irmen de Jong

Re: Ten rules to becoming a Python community member.

2011-08-15 Thread Neil Cerutti
On 2011-08-15, MRAB pyt...@mrabarnett.plus.com wrote: On 15/08/2011 17:18, Lucio Santi wrote: On Mon, Aug 15, 2011 at 9:06 AM, Neil Cerutti ne...@norwich.edu mailto:ne...@norwich.edu wrote: On 2011-08-14, Chris Angelico ros...@gmail.com mailto:ros...@gmail.com wrote: On Sun,

Reusable ways to wrapping thread locking techniques

2011-08-15 Thread python
I'm reviewing a lot of code that has thread acquire and release locks scattered throughout the code base. Would a better technique be to use -- http://mail.python.org/mailman/listinfo/python-list

Re: Reusable ways to wrapping thread locking techniques

2011-08-15 Thread python
Hit send too soon ... I'm reviewing a lot of code that has thread acquire and release locks scattered throughout the code base. Would a better technique be to use contextmanagers (for safe granular locking within a function) or decorators (function wide locks) to manage locks or am I making

Re: string to unicode

2011-08-15 Thread Terry Reedy
On 8/15/2011 11:29 AM, Adam Tauno Williams wrote: On Mon, 2011-08-15 at 08:20 -0700, Artie Ziff wrote: if I am using the standard csv library to read contents of a csv file which contains Unicode strings (short example: '\xe8\x9f\x92\xe8\x9b\x87'), how do I use a python Unicode method such as

datetime.strptime w/ non-UTC and non-local TZs?

2011-08-15 Thread Artur Ergashev
I was hoping somebody give me some clarity on how datetime.strptime is supposed to work, I'm thinking this is a bug, but wanted to see if the community has any ideas before I submit a bug to the python tracker. For reference I am in the CDT timezone... from datetime import datetime date_utc =

Re: string to unicode

2011-08-15 Thread Thomas 'PointedEars' Lahn
Chris Angelico wrote: On Mon, Aug 15, 2011 at 4:20 PM, Artie Ziff artie.z...@gmail.com wrote: if I am using the standard csv library to read contents of a csv file which contains Unicode strings (short example: '\xe8\x9f\x92\xe8\x9b\x87'), how do I use a python Unicode method such as decode

Re: allow line break at operators

2011-08-15 Thread rantingrick
On Aug 15, 2:31 am, Terry Reedy tjre...@udel.edu wrote: On 8/15/2011 12:28 AM, Seebs wrote: To repeat again: you are free to put in explicit dedent markers that will let you re-indent code should all indents be removed. As Terry has been trying to say for a while now, use the following

Why no warnings when re-assigning builtin names?

2011-08-15 Thread Gerrat Rickert
With surprising regularity, I see program postings (eg. on StackOverflow) from inexperienced Python users accidentally re-assigning built-in names. For example, they'll innocently call some variable, list, and assign a list of items to it. ...and if they're _unlucky_ enough, their program

Re: Why no warnings when re-assigning builtin names?

2011-08-15 Thread Philip Semanchuk
On Aug 15, 2011, at 5:52 PM, Gerrat Rickert wrote: With surprising regularity, I see program postings (eg. on StackOverflow) from inexperienced Python users accidentally re-assigning built-in names. For example, they'll innocently call some variable, list, and assign a list of items

Re: Why no warnings when re-assigning builtin names?

2011-08-15 Thread Chris Angelico
On Mon, Aug 15, 2011 at 10:52 PM, Gerrat Rickert grick...@coldstorage.com wrote: With surprising regularity, I see program postings (eg. on StackOverflow) from inexperienced Python users  accidentally re-assigning built-in names. For example, they’ll innocently call some variable, “list”, and

Re: Why no warnings when re-assigning builtin names?

2011-08-15 Thread Ethan Furman
Gerrat Rickert wrote: What sayest the Python community about having an explicit warning against such un-pythonic behaviour (re-assigning builtin names)? What makes you think this behavior is unpythonic? Python is not about hand-holding. ~Ethan~ --

Re: Why no warnings when re-assigning builtin names?

2011-08-15 Thread Seebs
On 2011-08-15, Ethan Furman et...@stoneleaf.us wrote: Gerrat Rickert wrote: What sayest the Python community about having an explicit warning against such un-pythonic behaviour (re-assigning builtin names)? What makes you think this behavior is unpythonic? Python is not about

Re: Why no warnings when re-assigning builtin names?

2011-08-15 Thread Ethan Furman
Seebs wrote: On 2011-08-15, Ethan Furman et...@stoneleaf.us wrote: Gerrat Rickert wrote: What sayest the Python community about having an explicit warning against such un-pythonic behaviour (re-assigning builtin names)? What makes you think this behavior is unpythonic? Python is not about

Re: Why no warnings when re-assigning builtin names?

2011-08-15 Thread Benjamin Kaplan
On Aug 15, 2011 5:56 PM, Gerrat Rickert grick...@coldstorage.com wrote: With surprising regularity, I see program postings (eg. on StackOverflow) from inexperienced Python users accidentally re-assigning built-in names. For example, they’ll innocently call some variable, “list”, and assign

testing if a list contains a sublist

2011-08-15 Thread Johannes
hi list, what is the best way to check if a given list (lets call it l1) is totally contained in a second list (l2)? for example: l1 = [1,2], l2 = [1,2,3,4,5] - l1 is contained in l2 l1 = [1,2,2,], l2 = [1,2,3,4,5] - l1 is not contained in l2 l1 = [1,2,3], l2 = [1,3,5,7] - l1 is not contained in

Re: Why no warnings when re-assigning builtin names?

2011-08-15 Thread Dan Stromberg
On Mon, Aug 15, 2011 at 2:52 PM, Gerrat Rickert grick...@coldstorage.comwrote: With surprising regularity, I see program postings (eg. on StackOverflow) from inexperienced Python users accidentally re-assigning built-in names. http://pypi.python.org/pypi/pylint checks for this and many other

Re: testing if a list contains a sublist

2011-08-15 Thread Dan Stromberg
Check out collections.Counter if you have 2.7 or up. If you don't, google for multiset or bag types. On Mon, Aug 15, 2011 at 4:26 PM, Johannes dajo.m...@web.de wrote: hi list, what is the best way to check if a given list (lets call it l1) is totally contained in a second list (l2)? for

Re: Reusable ways to wrapping thread locking techniques

2011-08-15 Thread Cameron Simpson
On 15Aug2011 13:56, pyt...@bdurham.com pyt...@bdurham.com wrote: | I'm reviewing a lot of code that has thread acquire and release | locks scattered throughout the code base. | | Would a better technique be to use contextmanagers (for safe | granular locking within a function) or decorators

Re: Data issues with Django and Apache

2011-08-15 Thread John Gordon
In j27bde$dlr$1...@reader1.panix.com John Gordon gor...@panix.com writes: The problem is that I get conflicting results as to whether these temporary records have reached their expiration date, depending if I search for them via an Apache web call or if I do the search locally from a python

Re: allow line break at operators

2011-08-15 Thread Roy Smith
In article mailman.10.1313417818.27778.python-l...@python.org, Chris Angelico ros...@gmail.com wrote: Or: Blasted PHP, which operators have precedence between || and or? which is easy to forget. And you're right about the details changing from language to language, hence the operators

Re: allow line break at operators

2011-08-15 Thread Roy Smith
In article 4e492d08$0$30003$c3e8da3$54964...@news.astraweb.com, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: I'm reminded of this quote from John Baez: The real numbers are the dependable breadwinner of the family, the complete ordered field we all rely on. The complex

Re: allow line break at operators

2011-08-15 Thread Chris Angelico
On Tue, Aug 16, 2011 at 1:34 AM, Roy Smith r...@panix.com wrote: In article mailman.10.1313417818.27778.python-l...@python.org,  Chris Angelico ros...@gmail.com wrote: Or: Blasted PHP, which operators have precedence between || and or? which is easy to forget. And you're right about the

Re: Ten rules to becoming a Python community member.

2011-08-15 Thread Gregory Ewing
rantingrick wrote: Used to and supposed to is the verbiage of children and idiots. So when we reach a certain age we're meant to abandon short, concise and idomatic ways of speaking, and substitute long words and phrases to make ourselves sound adult and educated? -- Greg --

Re: allow line break at operators

2011-08-15 Thread Gregory Ewing
Steven D'Aprano wrote: I'm reminded of this quote from John Baez: ...But the octonions are the crazy old uncle nobody lets out of the attic: they are nonassociative. (And don't even ask about the sedenions...) Aren't they the ones that mutilate cattle and abduct people? -- Greg --

Re: Ten rules to becoming a Python community member.

2011-08-15 Thread Gregory Ewing
I don't mind people using e.g. and i.e. as long as they use them *correctly*. Many times people use i.e. when they really mean e.g. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: allow line break at operators

2011-08-15 Thread Seebs
On 2011-08-16, Roy Smith r...@panix.com wrote: In article 4e492d08$0$30003$c3e8da3$54964...@news.astraweb.com, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: I'm reminded of this quote from John Baez: The real numbers are the dependable breadwinner of the family, the complete

Re: testing if a list contains a sublist

2011-08-15 Thread Roy Smith
In article mailman.27.1313450819.27778.python-l...@python.org, Johannes dajo.m...@web.de wrote: hi list, what is the best way to check if a given list (lets call it l1) is totally contained in a second list (l2)? for example: l1 = [1,2], l2 = [1,2,3,4,5] - l1 is contained in l2 l1 =

Re: Ten rules to becoming a Python community member.

2011-08-15 Thread Roy Smith
In article 9att2bf71...@mid.individual.net, Gregory Ewing greg.ew...@canterbury.ac.nz wrote: rantingrick wrote: Used to and supposed to is the verbiage of children and idiots. So when we reach a certain age we're meant to abandon short, concise and idomatic ways of speaking, and

Re: surprising interaction between function scope and class namespace

2011-08-15 Thread Gregory Ewing
Peter Otten wrote: LOAD_NAME is pretty dumb, it looks into the local namespace and if that lookup fails falls back to the global namespace. Someone probably thought I can do better, and reused the static name lookup for nested functions for names that occur only on the right-hand side of

Re: Why no warnings when re-assigning builtin names?

2011-08-15 Thread rantingrick
On Aug 15, 5:13 pm, Philip Semanchuk phi...@semanchuk.com wrote: On Aug 15, 2011, at 5:52 PM, Gerrat Rickert wrote: With surprising regularity, I see program postings (eg. on StackOverflow) from inexperienced Python users  accidentally re-assigning built-in names. For example, they'll

TestFixtures 1.12.0 Released!

2011-08-15 Thread Chris Withers
Hi All, I'm happy to announce a new release of TestFixtures with the following changes: - OutputCapture has grown a `captured` property and can now be temporarily disabled using their`disable` method: http://packages.python.org/testfixtures/streams.html - Logging can now be captured

Re: Why no warnings when re-assigning builtin names?

2011-08-15 Thread Steven D'Aprano
On Tue, 16 Aug 2011 08:15 am Chris Angelico wrote: On Mon, Aug 15, 2011 at 10:52 PM, Gerrat Rickert grick...@coldstorage.com wrote: With surprising regularity, I see program postings (eg. on StackOverflow) from inexperienced Python users  accidentally re-assigning built-in names. For

Re: Ten rules to becoming a Python community member.

2011-08-15 Thread Steven D'Aprano
On Tue, 16 Aug 2011 10:48 am Gregory Ewing wrote: rantingrick wrote: Used to and supposed to is the verbiage of children and idiots. So when we reach a certain age we're meant to abandon short, concise and idomatic ways of speaking, and substitute long words and phrases to make ourselves

Re: Ten rules to becoming a Python community member.

2011-08-15 Thread MRAB
On 16/08/2011 01:52, Gregory Ewing wrote: I don't mind people using e.g. and i.e. as long as they use them *correctly*. Many times people use i.e. when they really mean e.g. Can you give me an example? :-) -- http://mail.python.org/mailman/listinfo/python-list

Re: Ten rules to becoming a Python community member.

2011-08-15 Thread Roy Smith
In article 9att9mf71...@mid.individual.net, Gregory Ewing greg.ew...@canterbury.ac.nz wrote: I don't mind people using e.g. and i.e. as long as they use them *correctly*. The only correct way to use i.e. is to use it to download a better browser. --

Re: testing if a list contains a sublist

2011-08-15 Thread Steven D'Aprano
On Tue, 16 Aug 2011 09:26 am Johannes wrote: hi list, what is the best way to check if a given list (lets call it l1) is totally contained in a second list (l2)? This is not the most efficient algorithm, but for short lists it should be plenty fast enough: def contains(alist, sublist):

Re: Ten rules to becoming a Python community member.

2011-08-15 Thread Seebs
On 2011-08-16, Roy Smith r...@panix.com wrote: In article 9att9mf71...@mid.individual.net, Gregory Ewing greg.ew...@canterbury.ac.nz wrote: I don't mind people using e.g. and i.e. as long as they use them *correctly*. The only correct way to use i.e. is to use it to download a better

Re: Why no warnings when re-assigning builtin names?

2011-08-15 Thread Philip Semanchuk
On Aug 15, 2011, at 9:32 PM, Steven D'Aprano wrote: On Tue, 16 Aug 2011 08:15 am Chris Angelico wrote: If you want a future directive that deals with it, I'd do it the other way - from __future__ import mask_builtin_warning or something - so the default remains as it currently is. But this

Re: allow line break at operators

2011-08-15 Thread Teemu Likonen
* 2011-08-14T01:44:05-07:00 * Chris Rebert wrote: I've heard that Dylan is supposedly Lisp, sans parens. http://en.wikipedia.org/wiki/Dylan_(programming_language) It has copied/derived many features from Lisps but it's not a dialect of Lisp because of the syntax and its consequences. --

Windows service in production?

2011-08-15 Thread snorble
Anyone know of a Python application running as a Windows service in production? I'm planning a network monitoring application that runs as a service and reports back to the central server. Sort of a heartbeat type agent to assist with this server is down, go check on it type situations. If using

Re: allow line break at operators

2011-08-15 Thread rantingrick
On Aug 15, 11:13 pm, alex23 wuwe...@gmail.com wrote: Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: I think I would be less skeptical about fluent interfaces if they were written more like Unix shell script pipelines instead of using attribute access notation:

Re: Ten rules to becoming a Python community member.

2011-08-15 Thread rantingrick
On Aug 15, 7:48 pm, Gregory Ewing greg.ew...@canterbury.ac.nz wrote: rantingrick wrote: Used to and supposed to is the verbiage of children and idiots. So when we reach a certain age we're meant to abandon short, concise and idomatic ways of speaking, and substitute long words and phrases

How to use python environment created using virtualenv?

2011-08-15 Thread smith jack
I have created a python environment using virtualenv, but when i want to import such environment to PyDev, error just appears, it tells there should be a Libs dir, but there is no Libs DIr in the virtual envronment created using virtualenv, what should i do if i want to use this virtual

Re: Why no warnings when re-assigning builtin names?

2011-08-15 Thread Steven D'Aprano
On Tue, 16 Aug 2011 01:23 pm Philip Semanchuk wrote: On Aug 15, 2011, at 9:32 PM, Steven D'Aprano wrote: On Tue, 16 Aug 2011 08:15 am Chris Angelico wrote: If you want a future directive that deals with it, I'd do it the other way - from __future__ import mask_builtin_warning or

[issue12266] str.capitalize contradicts oneself

2011-08-15 Thread Roundup Robot
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset c34772013c53 by Ezio Melotti in branch '3.2': #12266: Fix str.capitalize() to correctly uppercase/lowercase titlecased and cased non-letter characters. http://hg.python.org/cpython/rev/c34772013c53 New changeset

[issue12266] str.capitalize contradicts oneself

2011-08-15 Thread Roundup Robot
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 1ea72da11724 by Ezio Melotti in branch 'default': #12266: merge with 3.2. http://hg.python.org/cpython/rev/1ea72da11724 -- ___ Python tracker rep...@bugs.python.org

[issue12266] str.capitalize contradicts oneself

2011-08-15 Thread Ezio Melotti
Ezio Melotti ezio.melo...@gmail.com added the comment: Fixed, thanks for the report! -- resolution: duplicate - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12266

[issue12729] Python lib re cannot handle Unicode properly due to narrow/wide bug

2011-08-15 Thread Tom Christiansen
Tom Christiansen tchr...@perl.com added the comment: Ezio Melotti rep...@bugs.python.org wrote on Mon, 15 Aug 2011 04:56:55 -: Another thing I noticed is that (at least on wide builds) surrogate pairs are not joined on the fly: p '\ud800\udc00' len(p) 2

[issue12266] str.capitalize contradicts oneself

2011-08-15 Thread Roundup Robot
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset d3816fa1bcdf by Ezio Melotti in branch '2.7': #12266: move the tests in test_unicode. http://hg.python.org/cpython/rev/d3816fa1bcdf -- ___ Python tracker

[issue12711] Explain tracker components in devguide

2011-08-15 Thread Ezio Melotti
Ezio Melotti ezio.melo...@gmail.com added the comment: Fixed in http://hg.python.org/devguide/rev/c9dd231b0940 -- resolution: - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org

[issue12746] normalization is affected by unicode width

2011-08-15 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: See also #12737. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12746 ___ ___

[issue12737] str.title() is overzealous by upcasing combining marks inappropriately

2011-08-15 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: See also #12746. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12737 ___ ___

[issue12746] normalization is affected by unicode width

2011-08-15 Thread Tom Christiansen
Changes by Tom Christiansen tchr...@perl.com: -- nosy: +tchrist ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12746 ___ ___ Python-bugs-list

[issue12729] Python lib re cannot handle Unicode properly due to narrow/wide bug

2011-08-15 Thread Marc-Andre Lemburg
Marc-Andre Lemburg m...@egenix.com added the comment: Keep in mind that we should be able to access and use lone surrogates too, therefore: s = '\ud800' # should be valid len(s) # should this raise an error? (or return 0.5 ;)? s[0] # error here too? list(s) # here too? p = s +

[issue12751] Use macros for surrogates in unicodeobject.c

2011-08-15 Thread STINNER Victor
New submission from STINNER Victor victor.stin...@haypocalc.com: A lot of code is duplicated in unicodeobject.c to manipulate (encode/decode) surrogates. Each function has from one to three different implementations. The new decode_ucs4() function adds a new implementation. Attached patch

[issue12751] Use macros for surrogates in unicodeobject.c

2011-08-15 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: We may use the following unlikely macro for IS_SURROGATE, IS_HIGH_SURROGATE and IS_LOW_SURROGATE: #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) I suppose that we should use

[issue12737] str.title() is overzealous by upcasing combining marks inappropriately

2011-08-15 Thread Ezio Melotti
Ezio Melotti ezio.melo...@gmail.com added the comment: So the issue here is that while using combing chars, str.title() fails to titlecase the string properly. The algorithm implemented by str.title() [0] is quite simple: it loops through the code units, and uppercases all the chars that

[issue12751] Use macros for surrogates in unicodeobject.c

2011-08-15 Thread Ezio Melotti
Ezio Melotti ezio.melo...@gmail.com added the comment: This has been proposed already in #10542 (the issue also has patches). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12751 ___

[issue12731] python lib re uses obsolete sense of \w in full violation of UTS#18 RL1.2a

2011-08-15 Thread Ezio Melotti
Ezio Melotti ezio.melo...@gmail.com added the comment: If the regex module works fine here, I think it's better to leave the re module alone and include the regex module in 3.3. -- ___ Python tracker rep...@bugs.python.org

[issue12734] Request for property support in Python re lib

2011-08-15 Thread Ezio Melotti
Ezio Melotti ezio.melo...@gmail.com added the comment: This indeed should be fixed by replacing 're' with 'regex'. So I would suggest to focus your tests on 'regex' and report them there so that possible bugs gets fixed and tested before we include the module in the stdlib. --

[issue12733] Request for grapheme support in Python re lib

2011-08-15 Thread Ezio Melotti
Ezio Melotti ezio.melo...@gmail.com added the comment: As I said on #12734 and #12731, if the 'regex' module address this issue, we should just wait until we include it in the stdlib. -- ___ Python tracker rep...@bugs.python.org

[issue12730] Python's casemapping functions are untrustworthy due to narrow/wide build issues

2011-08-15 Thread Ezio Melotti
Ezio Melotti ezio.melo...@gmail.com added the comment: This is actually a duplicated of #9200. @Terry Besides which, all I see (on Windowsj) in Firefox is things like 𐐼𐐯𐑅𐐨𐑉𐐯𐐻. Encoding problem. Firefox thinks this is some iso-8859-*. You can fix this selecting

[issue9200] Make str methods work with non-BMP chars on narrow builds

2011-08-15 Thread Ezio Melotti
Ezio Melotti ezio.melo...@gmail.com added the comment: I closed #12730 as a duplicate of this and updated the title of this issue. -- title: str.isprintable() is always False for large code points - Make str methods work with non-BMP chars on narrow builds

[issue10542] Py_UNICODE_NEXT and other macros for surrogates

2011-08-15 Thread Ezio Melotti
Ezio Melotti ezio.melo...@gmail.com added the comment: See also #12751. -- nosy: +tchrist ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10542 ___

[issue9200] Make str methods work with non-BMP chars on narrow builds

2011-08-15 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- nosy: +tchrist ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9200 ___ ___ Python-bugs-list

[issue12752] locale.normalize does not take unicode strings

2011-08-15 Thread Julian Taylor
New submission from Julian Taylor jtaylor.deb...@googlemail.com: using unicode strings for locale.normalize gives following traceback with python2.7: ~$ python2.7 -c 'import locale; locale.normalize(uen_US)' Traceback (most recent call last): File string, line 1, in module File

[issue12752] locale.normalize does not take unicode strings

2011-08-15 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- nosy: +ezio.melotti stage: - test needed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12752 ___

[issue12204] str.upper converts to title

2011-08-15 Thread Roundup Robot
Roundup Robot devn...@psf.upfronthosting.co.za added the comment: New changeset 16edc5cf4a79 by Ezio Melotti in branch '3.2': #12204: document that str.upper().isupper() might be False and add a note about cased characters. http://hg.python.org/cpython/rev/16edc5cf4a79 New changeset

[issue12204] str.upper converts to title

2011-08-15 Thread Ezio Melotti
Ezio Melotti ezio.melo...@gmail.com added the comment: Fixed, thanks for the report! -- resolution: - fixed stage: commit review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12204

[issue12729] Python lib re cannot handle Unicode properly due to narrow/wide bug

2011-08-15 Thread Matthew Barnett
Matthew Barnett pyt...@mrabarnett.plus.com added the comment: For what it's worth, I've had idea about string storage, roughly based on how *nix stores data on disk. If a string is small, point to a block of codepoints. If a string is medium-sized, point to a block of pointers to codepoint

[issue12752] locale.normalize does not take unicode strings

2011-08-15 Thread Julian Taylor
Julian Taylor jtaylor.deb...@googlemail.com added the comment: this is a regression introduced by fixing http://bugs.python.org/issue1813 This breaks some user code,. e.g. wx.Locale.GetCanonicalName returns unicode. Example bugs:

[issue12752] locale.normalize does not take unicode strings

2011-08-15 Thread Marc-Andre Lemburg
Marc-Andre Lemburg m...@egenix.com added the comment: Julian Taylor wrote: New submission from Julian Taylor jtaylor.deb...@googlemail.com: using unicode strings for locale.normalize gives following traceback with python2.7: ~$ python2.7 -c 'import locale; locale.normalize(uen_US)'

  1   2   >