Re: Asymmetry in globals __getitem__/__setitem__

2014-06-12 Thread Marko Rauhamaa
Gregory Ewing : > I didn't think that using a custom mapping object for globals was > officially supported. Has that changed? The documentation is a bit vague about it: If only globals is provided, it must be a dictionary, which will be used for both the global and the local variables. If

Re: Suds 4.1 Beta Assertion Failure

2014-06-12 Thread dieter
1stpo...@gmail.com writes: > ... > I have another issue. When I make the call to return data apparently the > result set is too big for suds and I get a MemoryError. > > Here is my code snippet: > print 'executing SQL Query:',len(logicalSQL) > > executionOptions={'async':False,'maxRowsPe

Re: Python deepcopy to while statement

2014-06-12 Thread hito koto
2014年6月13日金曜日 12時47分19秒 UTC+9 hito koto: > Hi, all > > > > I want to make the function use while statement,and without a deepcopy > functions. > > > > this is my use deepcopy function correct codes, So, how can i to do a > different way and use while statement: > > > > def foo(x): >

Re: Python deepcopy to while statement

2014-06-12 Thread hito koto
2014年6月13日金曜日 12時47分19秒 UTC+9 hito koto: > Hi, all > > > > I want to make the function use while statement,and without a deepcopy > functions. > > > > this is my use deepcopy function correct codes, So, how can i to do a > different way and use while statement: > > > > def foo(x): >

C-API proper initialization and deallocation of subclasses

2014-06-12 Thread ptb
Hello all, I decided to play around with the C-API and have gotten stuck. I went through the Shoddy example (https://docs.python.org/3/extending/newtypes.html#subclassing-other-types) in the docs and tried to extend it by adding a method which creates and returns a shoddy instance. I dug aro

Python deepcopy to while statement

2014-06-12 Thread hito koto
Hi, all I want to make the function use while statement,and without a deepcopy functions. this is my use deepcopy function correct codes, So, how can i to do a different way and use while statement: def foo(x): if not isinstance(x, list): return x return [foo(y) for y in x]

Re: OT: This Swift thing

2014-06-12 Thread Steven D'Aprano
On Fri, 13 Jun 2014 03:18:00 +1000, Chris Angelico wrote: > On Fri, Jun 13, 2014 at 3:04 AM, Steven D'Aprano > wrote: [...] >> Take three numbers, speeds in this case, s1, s2 and c, with c a strict >> upper-bound. We can take: >> >> s1 < s2 < c >> >> without loss of generality. So in this case, w

Re: http://bugs.python.org/issue19495 timeit enhancement

2014-06-12 Thread Cameron Simpson
On 13Jun2014 00:44, Steven D'Aprano wrote: On Fri, 13 Jun 2014 00:35:43 +0100, Mark Lawrence wrote: The request is for a class within timeit that allows you to test code inside a with block. It strikes me as being useful but there's only one response on the issue, albeit a positive one. If o

Re: OT: This Swift thing

2014-06-12 Thread Rustom Mody
On Thursday, June 12, 2014 10:48:00 PM UTC+5:30, Chris Angelico wrote: > On Fri, Jun 13, 2014 at 3:04 AM, Steven D'Aprano > > Take three numbers, speeds in this case, s1, s2 and c, with c a strict > > upper-bound. We can take: > > s1 < s2 < c > > without loss of generality. So in this case, we say

Re: http://bugs.python.org/issue19495 timeit enhancement

2014-06-12 Thread Steven D'Aprano
On Fri, 13 Jun 2014 00:35:43 +0100, Mark Lawrence wrote: > The request is for a class within timeit that allows you to test code > inside a with block. It strikes me as being useful but there's only one > response on the issue, albeit a positive one. If others here think this > would be a useful

Re: Asymmetry in globals __getitem__/__setitem__

2014-06-12 Thread Gregory Ewing
Robert Lehmann wrote: I have noticed there is a slight asymmetry in the way the interpreter (v3.3.5, reproduced also in v3.5.x) loads and stores globals. While loading globals from a custom mapping triggers __getitem__ just fine, writing seems to silently ignore __setitem__. I didn't think t

Re: Lines on a tkinter.Canvas

2014-06-12 Thread Gregory Ewing
Pedro Izecksohn wrote: Thank you Greg. Your second approach works and the script became: That's not really what I meant; doing it that way, you're still incurring the overhead of a tk canvas object for each point that you draw. However, if there are only 250 points or so, it might not matter.

Re: idle glitch while building python 3.4 from sources

2014-06-12 Thread Terry Reedy
On 6/12/2014 4:35 PM, kfs...@gmail.com wrote: I just upgraded to Python 3.4.1 AMD64 for Windows 7 using the binaries, Upgraded from what to what with what? Which binaries? Details matter. and this appears to have affected the Windows binary distribution. osmith@WOTSIT /c/Python34/Lib/

http://bugs.python.org/issue19495 timeit enhancement

2014-06-12 Thread Mark Lawrence
The request is for a class within timeit that allows you to test code inside a with block. It strikes me as being useful but there's only one response on the issue, albeit a positive one. If others here think this would be a useful addition I'll see if I can take this forward, unless there ar

Re: Lines on a tkinter.Canvas

2014-06-12 Thread Pedro Izecksohn
- Original Message - > From: Gregory Ewing > To: python-list@python.org > Cc: > Sent: Thursday, June 12, 2014 8:38 AM > Subject: Re: Lines on a tkinter.Canvas > > Pedro Izecksohn wrote: >> The Canvas' method create_line turns on at least 2 pixels. But I want > to turn >> on many singl

Re: Lines on a tkinter.Canvas

2014-06-12 Thread Pedro Izecksohn
- Original Message - > From: Gregory Ewing > To: python-list@python.org > Sent: Thursday, June 12, 2014 8:38 AM > Subject: Re: Lines on a tkinter.Canvas > > Pedro Izecksohn wrote: >> The Canvas' method create_line turns on at least 2 pixels. But I want > to turn >> on many single pixel

Re: idle glitch while building python 3.4 from sources

2014-06-12 Thread kfsone
I just upgraded to Python 3.4.1 AMD64 for Windows 7 using the binaries, and this appears to have affected the Windows binary distribution. osmith@WOTSIT /c/Python34/Lib/idlelib $ python idle.py ** IDLE can't import Tkinter. Your Python may not be configured for Tk. ** -- https://ma

Re: Lines on a tkinter.Canvas

2014-06-12 Thread Pedro Izecksohn
  As Peter Otten did not see the same result that I saw, I prepared an image that shows the result on my notebook: http://izecksohn.com/pedro/python/canvas/tk_window.xcf   For those that might not know: xcf is the Gimp's file format. - Original Message - > From: Peter Otten > To: python-

Re: OT: This Swift thing

2014-06-12 Thread Gene Heskett
On Thursday 12 June 2014 13:18:00 Chris Angelico did opine And Gene did reply: > On Fri, Jun 13, 2014 at 3:04 AM, Steven D'Aprano > > > I'm saying that, whatever the practical engineering limits turn out > > to be, we're unlikely to be close to them, and therefore there are > > very likely to be m

Re: Suds 4.1 Beta Assertion Failure

2014-06-12 Thread 1stpoint
It turns out I was passing the parameters incorrectly to the generateReportSQL method. This is what I had: result=reportservice.generateReportSQL(rptRef, paramRpt, sessionid) This is what works: result=XMLservice.generateReportSQL({'reportPath':rptRef},sessionid) I have another issue. When I

Re: Asymmetry in globals __getitem__/__setitem__

2014-06-12 Thread Chris Angelico
On Fri, Jun 13, 2014 at 4:18 AM, Robert Lehmann wrote: > PS. I found a 3.3.x commit (e3ab8aa) which fixed the LOAD_GLOBAL opcode to > support other types than dict, but STORE_GLOBAL seems to use bare > PyDict_SetItem instead of dispatching to PyObject_SetItem. > This looks like something for a t

Re: Asymmetry in globals __getitem__/__setitem__

2014-06-12 Thread Ian Kelly
On Thu, Jun 12, 2014 at 12:18 PM, Robert Lehmann wrote: > Hi all, > > I have noticed there is a slight asymmetry in the way the interpreter > (v3.3.5, reproduced also in v3.5.x) loads and stores globals. While loading > globals from a custom mapping triggers __getitem__ just fine, writing seems >

Asymmetry in globals __getitem__/__setitem__

2014-06-12 Thread Robert Lehmann
Hi all, I have noticed there is a slight asymmetry in the way the interpreter (v3.3.5, reproduced also in v3.5.x) loads and stores globals. While loading globals from a custom mapping triggers __getitem__ just fine, writing seems to silently ignore __setitem__. class Namespace(dict): def __g

Re: Lines on a tkinter.Canvas

2014-06-12 Thread Terry Reedy
On 6/12/2014 7:38 AM, Gregory Ewing wrote: Pedro Izecksohn wrote: The Canvas' method create_line turns on at least 2 pixels. But I want to turn on many single pixels on a Canvas. You could try using a 1x1 rectangle instead. However, be aware that either of these will use quite a lot of memory

كأس العالم FIFA 2014

2014-06-12 Thread essd
كأس العالم FIFA 2014 https://www.facebook.com/pages/%D9%86%D8%AA%D8%A7%D8%A6%D8%AC-%D8%A7%D9%84%D8%A7%D9%85%D8%AA%D8%AD%D8%A7%D9%86%D8%A7%D8%AA-%D9%88%D8%A7%D9%84%D8%AC%D8%A7%D9%85%D8%B9%D8%A7%D8%AA-%D9%88%D8%A7%D8%AC%D8%AA%D9%85%D8%A7%D8%B9%D9%8A%D8%A7%D8%AA/299719160065550 كأس العالم: البرازيل ت

Re: About python while statement and pop()

2014-06-12 Thread Mark H Harris
On 6/12/14 11:57 AM, Chris Angelico wrote: def poplist(L): done = False while done==False: yield L[::-1][:1:] L = L[::-1][1::][::-1] if len(L)==0: done=True Why not just "while L"? OK, here it is with Chris' excellent adv

Re: OT: This Swift thing

2014-06-12 Thread Chris Angelico
On Fri, Jun 13, 2014 at 3:04 AM, Steven D'Aprano wrote: > Chris made the argument that *the laws of physics* put limits on what we > can attain, which is fair enough, but then made the poor example of speed > limits on roads falling short of the speed of light. Yes, speed limits on > roads fall co

Re: About python while statement and pop()

2014-06-12 Thread Mark H Harris
On 6/12/14 11:57 AM, Chris Angelico wrote: On Fri, Jun 13, 2014 at 2:49 AM, Mark H Harris wrote: Consider this generator variation: def poplist(L): done = False while done==False: yield L[::-1][:1:] L = L[::-1][1::][::-1]

Re: About python while statement and pop()

2014-06-12 Thread Mark H Harris
On 6/12/14 11:55 AM, Marko Rauhamaa wrote: while not done: Better Python and not bad English, either. ... and taking Marko's good advice, what I think you really wanted: >>> def poplist(L): done = False while not done: yield L[::-1][:1:] L

Re: About python while statement and pop()

2014-06-12 Thread Marko Rauhamaa
> while done==False: Correction: while not done: Better Python and not bad English, either. Marko -- https://mail.python.org/mailman/listinfo/python-list

Re: OT: This Swift thing

2014-06-12 Thread Steven D'Aprano
On Thu, 12 Jun 2014 05:54:47 -0700, Rustom Mody wrote: > On Thursday, June 12, 2014 2:36:50 PM UTC+5:30, Steven D'Aprano wrote: [...] >> > The laws of physics tend to put >> > boundaries that are ridiculously far from where we actually work - I >> > think most roads have speed limits that run a fa

Re: Python MSI Repo

2014-06-12 Thread Zachary Ware
On Thu, Jun 12, 2014 at 8:47 AM, Alex Rodrigues wrote: > Is there a public repository for the python windows installer? > > I'd like to play around with it. The installer is built using msi.py, found in the tools directory of the main cpython repository: http://hg.python.org/cpython/file/default/

Re: About python while statement and pop()

2014-06-12 Thread Chris Angelico
On Fri, Jun 13, 2014 at 2:49 AM, Mark H Harris wrote: > Consider this generator variation: > def poplist(L): > done = False > while done==False: > > yield L[::-1][:1:] > L = L[::-1][1::][::-1] > if len(L)==0: done=True Why not j

Re: About python while statement and pop()

2014-06-12 Thread Mark H Harris
On 6/11/14 10:12 PM, hito koto wrote: def foo(x): y = [] while x !=[]: y.append(x.pop()) return y Consider this generator variation: >>> def poplist(L): done = False while done==False: yield L[::-1][:1:] L = L[::-1][1::]

Re: About python while statement and pop()

2014-06-12 Thread Mark H Harris
On 6/11/14 10:12 PM, hito koto wrote: i want to change this is code: def foo(x): y = [] while x !=[]: y.append(x.pop()) return y Consider this generator (all kinds of permutations on the idea): >>> L1 [1, 2, 3, 4, 5, 6, 7] >>> def poplist(L): while True:

Re: Python MSI Repo

2014-06-12 Thread Ned Batchelder
On 6/12/14 9:47 AM, Alex Rodrigues wrote: Is there a public repository for the python windows installer? I'd like to play around with it. - Alex I'm no expert on what the source for a windows installer looks like, but there seem to be things that smell like that in the PC and PCbuild direc

Python MSI Repo

2014-06-12 Thread Alex Rodrigues
Is there a public repository for the python windows installer? I'd like to play around with it. - Alex -- https://mail.python.org/mailman/listinfo/python-list

Re: OT: This Swift thing

2014-06-12 Thread Rustom Mody
I am bewildered by this argument... [Heck Ive recently learnt that using ellipses is an easy way to produce literature... So there...] On Thursday, June 12, 2014 2:36:50 PM UTC+5:30, Steven D'Aprano wrote: > It is my contention that, had Intel and AMD spent the last few decades > optimizing fo

Re: Lines on a tkinter.Canvas

2014-06-12 Thread Gregory Ewing
Pedro Izecksohn wrote: The Canvas' method create_line turns on at least 2 pixels. But I want to turn on many single pixels on a Canvas. You could try using a 1x1 rectangle instead. However, be aware that either of these will use quite a lot of memory per pixel. If you are drawing a very large

Re: OT: This Swift thing

2014-06-12 Thread Gregory Ewing
Steven D'Aprano wrote: It is my contention that, had Intel and AMD spent the last few decades optimizing for power consumption rather than speed, we probably could run a server off, well, perhaps not a watch battery, Current draw of CMOS circuitry is pretty much zero when nothing is changing,

Re: About python while statement and pop()

2014-06-12 Thread hito koto
2014年6月12日木曜日 14時43分42秒 UTC+9 Steven D'Aprano: > On Wed, 11 Jun 2014 21:56:06 -0700, hito koto wrote: > > > > > I want to use while statement, > > > > > > for example: > > def foo(x): > > > ... y = [] > > > ... while x !=[]: > > > ... y.append(x.pop()) > > > ...

Re: OT: This Swift thing

2014-06-12 Thread alister
On Thu, 12 Jun 2014 09:06:50 +, Steven D'Aprano wrote: > On Thu, 12 Jun 2014 12:16:08 +1000, Chris Angelico wrote: > >> On Thu, Jun 12, 2014 at 12:08 PM, Steven D'Aprano >> wrote: >>> I'm just pointing out that our computational technology uses over a >>> million times more energy than the t

Re: OT: This Swift thing

2014-06-12 Thread Steven D'Aprano
On Thu, 12 Jun 2014 12:16:08 +1000, Chris Angelico wrote: > On Thu, Jun 12, 2014 at 12:08 PM, Steven D'Aprano > wrote: >> I'm just pointing out that our computational technology uses over a >> million times more energy than the theoretical minimum, and therefore >> there is a lot of room for effi

Re: asyncio - how to stop loop?

2014-06-12 Thread Frank Millman
"Ian Kelly" wrote in message news:CALwzidnv07Wba9WJ=nuc0_v4mvudyaxwh6bgjvw0o1hf3oo...@mail.gmail.com... > On Wed, Jun 11, 2014 at 1:19 AM, Frank Millman wrote: >> First attempt - same as before >> >> loop = asyncio.get_event_loop() >> threading.Thread(target=loop.run_forever).start() >>

Al madinah international university opening apply for university colleges (September season)

2014-06-12 Thread Marwa Kotb
MR/ MiSS * al madinah international university which win dependence Malaysian Ministry of Higher Education Malaysia (MOHE) and also winning the adoption of all academic programs and courses, the university that are approved by the Malaysian funds and private academy, which deals with q

Re: About python while statement and pop()

2014-06-12 Thread hito koto
2014年6月12日木曜日 14時43分42秒 UTC+9 Steven D'Aprano: > On Wed, 11 Jun 2014 21:56:06 -0700, hito koto wrote: > > > > > I want to use while statement, > > > > > > for example: > > def foo(x): > > > ... y = [] > > > ... while x !=[]: > > > ... y.append(x.pop()) > > > ...

Re: Lines on a tkinter.Canvas

2014-06-12 Thread Peter Otten
Pedro Izecksohn wrote: > The code available from: > http://izecksohn.com/pedro/python/canvas/testing.py > draws 2 horizontal lines on a Canvas. Why the 2 lines differ on thickness > and length? > > The Canvas' method create_line turns on at least 2 pixels. But I want to > turn on many single pixe