Re: allow line break at operators

2011-08-15 Thread alex23
On Aug 16, 2:37 pm, rantingrick wrote: > The reading proceeds naturally from right to left. Well, "naturally" if you're coding in Hebrew or Japanese perhaps :) -- http://mail.python.org/mailman/listinfo/python-list

Re: testing if a list contains a sublist

2011-08-15 Thread Laszlo Nagy
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 conta

Re: testing if a list contains a sublist

2011-08-15 Thread ChasBrown
On Aug 15, 4:26 pm, 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)? > > 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 > l

Re: testing if a list contains a sublist

2011-08-15 Thread ChasBrown
On Aug 15, 4:26 pm, 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)? > > 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 > l

Re: testing if a list contains a sublist

2011-08-15 Thread ChasBrown
On Aug 15, 4:26 pm, 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)? > > 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 > l

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_warnin

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 environment

Re: Ten rules to becoming a Python community member.

2011-08-15 Thread rantingrick
On Aug 15, 7:48 pm, 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 oursel

Re: allow line break at operators

2011-08-15 Thread rantingrick
On Aug 15, 11:13 pm, alex23 wrote: > Steven D'Aprano 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: > > > foo.array_of_things | sort | map block | join ", " > > I'v

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 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. -- http

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. B

Re: Ten rules to becoming a Python community member.

2011-08-15 Thread Seebs
On 2011-08-16, Roy Smith wrote: > In article <9att9mf71...@mid.individual.net>, > Gregory Ewing 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. Similarly: Boy, is the

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 Roy Smith
In article <9att9mf71...@mid.individual.net>, Gregory Ewing 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. -- http://mail.python.org/mailman/listinfo/python-list

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 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 mak

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 > 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 i

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 only

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

2011-08-15 Thread rantingrick
On Aug 15, 5:13 pm, Philip Semanchuk 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 innocently

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 ass

Re: Ten rules to becoming a Python community member.

2011-08-15 Thread Roy Smith
In article <9att2bf71...@mid.individual.net>, 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 wor

Re: testing if a list contains a sublist

2011-08-15 Thread Roy Smith
In article , 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)? > > 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 =

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 wrote: > In article <4e492d08$0$30003$c3e8da3$54964...@news.astraweb.com>, > Steven D'Aprano 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 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 -- http://

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 -- http://mail.py

Re: allow line break at operators

2011-08-15 Thread Chris Angelico
On Tue, Aug 16, 2011 at 1:34 AM, Roy Smith wrote: > In article , >  Chris Angelico 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 tabl

Re: allow line break at operators

2011-08-15 Thread Roy Smith
In article , Chris Angelico 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 table *for each language*. But most languages > follow fairly sa

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 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 numbers are a slightly flashier > bu

Re: Data issues with Django and Apache

2011-08-15 Thread John Gordon
In John Gordon 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 shell. > And to make it weirder, the conflicts g

Re: Reusable ways to wrapping thread locking techniques

2011-08-15 Thread Cameron Simpson
On 15Aug2011 13:56, 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 (function wide | locks)

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 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

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 wrote: > 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 issues. I don't know

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 i

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

2011-08-15 Thread Benjamin Kaplan
On Aug 15, 2011 5:56 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 t

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

2011-08-15 Thread Ethan Furman
Seebs wrote: On 2011-08-15, Ethan Furman 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 hand-holding. It

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

2011-08-15 Thread Seebs
On 2011-08-15, Ethan Furman 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 > hand-holding. It seems

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~ -- http://mail.python.org/mailman/listinfo/pyt

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 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 it

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

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 m

Re: allow line break at operators

2011-08-15 Thread rantingrick
On Aug 15, 2:31 am, Terry Reedy 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 methods to quell y

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 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

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_ut

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 de

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 thing

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: Ten rules to becoming a Python community member.

2011-08-15 Thread Neil Cerutti
On 2011-08-15, MRAB wrote: > On 15/08/2011 17:18, Lucio Santi wrote: >> On Mon, Aug 15, 2011 at 9:06 AM, Neil Cerutti > > wrote: >> >> On 2011-08-14, Chris Angelico > > 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 MRAB
On 15/08/2011 17:18, Lucio Santi wrote: On Mon, Aug 15, 2011 at 9:06 AM, Neil Cerutti mailto:ne...@norwich.edu>> wrote: On 2011-08-14, Chris Angelico mailto:ros...@gmail.com>> wrote: > On Sun, Aug 14, 2011 at 2:21 PM, Irmen de Jong mailto:irmen.nos...@xs4all.nl>> wrote: >> On

Re: allow line break at operators

2011-08-15 Thread Seebs
On 2011-08-15, Roy Smith 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 (especially si

Re: allow line break at operators

2011-08-15 Thread Seebs
On 2011-08-15, Steven D'Aprano 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 sorted_array] >> ", ".jo

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: 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 wrote: > On 2011-08-14, Chris Angelico wrote: > > On Sun, Aug 14, 2011 at 2:21 PM, Irmen de Jong > 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 time

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 ty

Re: string to unicode

2011-08-15 Thread Chris Angelico
On Mon, Aug 15, 2011 at 4:20 PM, 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 i

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 (byt

Re: allow line break at operators

2011-08-15 Thread Chris Angelico
On Mon, Aug 15, 2011 at 3:28 PM, Steven D'Aprano 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 mathematics; it's because floating po

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 2:41 PM, Roy Smith 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: allow line break at operators

2011-08-15 Thread Roy Smith
In article , Chris Angelico 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 conventions only in the most vague ways. For example, standard

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 fo

Re: allow line break at operators

2011-08-15 Thread Johann Hibschman
Chris Angelico 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 > and subtracti

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 -- http://mail.python.org/mailma

Re: Ten rules to becoming a Python community member.

2011-08-15 Thread Neil Cerutti
On 2011-08-14, Chris Angelico wrote: > On Sun, Aug 14, 2011 at 2:21 PM, Irmen de Jong 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 invite to >>> Guido's next birt

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] ", ".join

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

Re: surprising interaction between function scope and class namespace

2011-08-15 Thread Duncan Booth
Stefan Behnel 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. Therefore, the A on th

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) Tr

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

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

Re: allow line break at operators

2011-08-15 Thread Paul Woolcock
On Aug 14, 2011 3:24 PM, "Seebs" 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 > > to protect yo

Re: pythonw.exe

2011-08-15 Thread Chris Angelico
On Mon, Aug 15, 2011 at 3:14 AM, Dennis Lee Bieber 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 technically was the

Re: allow line break at operators

2011-08-15 Thread Chris Angelico
On Mon, Aug 15, 2011 at 5:28 AM, Seebs 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 from 16 spaces dow

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 las

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

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 th