Re: [Python-Dev] Dinamically set __call__ method

2014-11-07 Thread dieter
Ethan Furman writes: > On 11/06/2014 10:59 PM, dieter wrote: >> John Ladasky writes: >>> On Tuesday, November 4, 2014 11:12:31 AM UTC-8, Ethan Furman wrote: >>> If you really absolutely positively have to have the signature be correct for each instance, you may to either look at a

Re: bdist_rpm with --requires and version

2014-11-07 Thread Chris Angelico
On Sat, Nov 8, 2014 at 2:18 AM, wrote: > But how to? ... > python setup.py bdist_rpm --requires=another-package>=2.1 > > Of course this will generate a "=2.1" file which is > of course not wanted. What shell are you on? On POSIX shells, just quote or escape the relevant part. On Windows... I'm

Re: How do i reduce this to a single function - the code is largely similar, just a direction of search toggle.

2014-11-07 Thread Denis McMahon
On Fri, 07 Nov 2014 16:46:19 +0630, Veek M wrote: (1) Pass a true or false parameter to the function as the direction of search toggle. (2) replace the relevant assignments with something like: variable = something if condition else something else (3) Figuring out the while loop control is a b

Re: How do i reduce this to a single function - the code is largely similar, just a direction of search toggle.

2014-11-07 Thread Veek M
Veek M wrote: > new_col = self.b[row].index('def') > self.w.cursor = row, new_col > new_col = self.b[row].rindex('def') > self.w.cursor = row, new_col There's also the different methods index vs rindex. Does this sort of thing jus

Re: Different behaviour in list comps and generator expressions

2014-11-07 Thread Roy Smith
In article <545d76fe$0$12980$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: > The following list comprehension and generator expression are almost, but > not quite, the same: > > [expr for x in iterable] > > list(expr for x in iterable) > > > The difference is in the handling of

Different behaviour in list comps and generator expressions

2014-11-07 Thread Steven D'Aprano
The following list comprehension and generator expression are almost, but not quite, the same: [expr for x in iterable] list(expr for x in iterable) The difference is in the handling of StopIteration raised inside the expr. Generator expressions consume them and halt, while comprehensions allow

Re: generating 2D bit array variants with specific algorythm

2014-11-07 Thread sohcahtoa82
On Friday, November 7, 2014 1:13:27 PM UTC-8, Gregory Ewing wrote: > Robert Voigtländer wrote: > > > I need to generate all variants of a 2D array with variable dimension sizes > > which fit a specific rule. (up to 200*1000) > > Um... you realise there are 200**1000 solutions for the > 200x1000 c

Re: Call for information - What assumptions can I make about Unix users' access to Windows?

2014-11-07 Thread Steven D'Aprano
Paul Moore wrote: > To that end, I'd like to get an idea of what sort of access to Windows > a typical Unix developer would have. I'm particularly interested in > whether Windows XP/Vista is still in use, and whether you're likely to > already have Python and/or any development tools installed. Id

Re: How do i reduce this to a single function - the code is largely similar, just a direction of search toggle.

2014-11-07 Thread Chris Angelico
On Fri, Nov 7, 2014 at 9:16 PM, Veek M wrote: > def jump_to_blockD(self): > end = len(self.b) > row, col = self.w.cursor > while row <= end: > try: > new_col = self.b[row].index('def') > self.w.cursor = row, new_col >

Re: How do i reduce this to a single function - the code is largely similar, just a direction of search toggle.

2014-11-07 Thread Denis McMahon
On Fri, 07 Nov 2014 21:22:22 +0630, Veek M wrote: > Veek M wrote: > > >> new_col = self.b[row].index('def') self.w.cursor = row, >> new_col > >> new_col = self.b[row].rindex('def') >> self.w.cursor = row, new_col > > There's also

Re: How do i reduce this to a single function - the code is largely similar, just a direction of search toggle.

2014-11-07 Thread Joel Goldstick
On Fri, Nov 7, 2014 at 5:16 AM, Veek M wrote: > def jump_to_blockD(self): > end = len(self.b) > row, col = self.w.cursor > while row <= end: > try: > new_col = self.b[row].index('def') > self.w.cursor = row, new_col >

Re: generating 2D bit array variants with specific algorythm

2014-11-07 Thread Gregory Ewing
Robert Voigtländer wrote: I need to generate all variants of a 2D array with variable dimension sizes which fit a specific rule. (up to 200*1000) Um... you realise there are 200**1000 solutions for the 200x1000 case? Are you sure that's really what you want? -- Greg -- https://mail.python.org

How do i reduce this to a single function - the code is largely similar, just a direction of search toggle.

2014-11-07 Thread Veek M
def jump_to_blockD(self): end = len(self.b) row, col = self.w.cursor while row <= end: try: new_col = self.b[row].index('def') self.w.cursor = row, new_col break except ValueError: pa

Re:generating 2D bit array variants with specific algorythm

2014-11-07 Thread Dave Angel
Robert Voigtländer Wrote in message: > Hi, > > I need to generate all variants of a 2D array with variable dimension sizes > which fit a specific rule. (up to 200*1000) > > The rules are: > - Values are only 0 or 1 > - the sum of each line bust be 1 > - only valid results must be generated (gen

Re: [Distutils] Call for information - What assumptions can I make about Unix users' access to Windows?

2014-11-07 Thread Paul Moore
On 7 November 2014 17:42, Ben Finney wrote: >> Does this prevent you from creating a VM on a cloud provider on your >> own account? > > If I need to accept restrictions such as the above, I don't see that the > location of the instance (nor the fees charged) has any affect on these > concerns. The

Re: [Distutils] Call for information - What assumptions can I make about Unix users' access to Windows?

2014-11-07 Thread Paul Moore
On 7 November 2014 17:17, Ben Finney wrote: > Paul Moore writes: > >> On 7 November 2014 16:52, Ben Finney wrote: >> > If I was required to provide packages for MS Windows, the only viable >> > solutions would be those that don't involve me obtaining an MS Windows >> > instance myself. >> >> For

Re: [Distutils] Call for information - What assumptions can I make about Unix users' access to Windows?

2014-11-07 Thread Paul Moore
On 7 November 2014 16:52, Ben Finney wrote: > If I was required to provide packages for MS Windows, the only viable > solutions would be those that don't involve me obtaining an MS Windows > instance myself. For that usage, an Amazon EC2 AMI sounds ideal, as the license costs are covered by the A

RE: [Distutils] Call for information - What assumptions can I make about Unix users' access to Windows?

2014-11-07 Thread Steve Dower
Ben Finney wrote: > Paul Moore writes: > >> To that end, I'd like to get an idea of what sort of access to Windows >> a typical Unix developer would have. […] Ideally, a clean Windows 7 or >> later virtual machine is the best environment, but I don't know if >> it's reasonable to assume that. >

Re: generating 2D bit array variants with specific algorythm

2014-11-07 Thread ast
"ast" a écrit dans le message de news:545cf9f0$0$2913$426a3...@news.free.fr... On base C, a number may be represented with N(L-1)N(L-2) ... N(1)N(0) where N(i) goes from 0 to C-1 -- https://mail.python.org/mailman/listinfo/python-list

Re: generating 2D bit array variants with specific algorythm

2014-11-07 Thread ast
"Robert Voigtländer" a écrit dans le message de news:0e6787f9-88d6-423a-8410-7578fa83d...@googlegroups.com... Let be L the number of lines and C the numbers of column You solve your problem just with counting on base C On base C, a number may be represented with N(L-1)N(L-2) ... N(0)N(0) w

Re: generating 2D bit array variants with specific algorythm

2014-11-07 Thread ast
"Robert Voigtländer" a écrit dans le message de news:e5c93b46-a32b-4eca-a00d-f7dd2b4bb...@googlegroups.com... 1011 What I mean is do you throw away the carry or does each row have only one zero? Not sure what you mean. Each row must have one 1. The rest must be 0. No combinations not fitting

Re: generating 2D bit array variants with specific algorythm

2014-11-07 Thread Peter Otten
Robert Voigtländer wrote: > Hi, > > I need to generate all variants of a 2D array with variable dimension > sizes which fit a specific rule. (up to 200*1000) > > The rules are: > - Values are only 0 or 1 > - the sum of each line bust be 1 > - only valid results must be generated (generating all

Re: [Distutils] Call for information - What assumptions can I make about Unix users' access to Windows?

2014-11-07 Thread Wichert Akkerman
> On 07 Nov 2014, at 16:46, Paul Moore wrote: > > I'm in the process of developing an automated solution to allow users > to quickly set up a Windows box so that it can be used to compile > Python extensions and build wheels. While it can obviously be used by > Windows developers who want to qui

Re: generating 2D bit array variants with specific algorythm

2014-11-07 Thread Robert Voigtländer
> 1011 > What I mean is do you throw away the carry or does each row have only one > zero? Not sure what you mean. Each row must have one 1. The rest must be 0. No combinations not fitting this rule must be generated. -- https://mail.python.org/mailman/listinfo/python-list

Re: generating 2D bit array variants with specific algorythm

2014-11-07 Thread Joel Goldstick
On Fri, Nov 7, 2014 at 10:39 AM, Robert Voigtländer wrote: > Hi, > > I need to generate all variants of a 2D array with variable dimension sizes > which fit a specific rule. (up to 200*1000) > > The rules are: > - Values are only 0 or 1 > - the sum of each line bust be 1 > - only valid results mu

Re: [Distutils] Call for information - What assumptions can I make about Unix users' access to Windows?

2014-11-07 Thread Donald Stufft
> On Nov 7, 2014, at 10:46 AM, Paul Moore wrote: > > I'm in the process of developing an automated solution to allow users > to quickly set up a Windows box so that it can be used to compile > Python extensions and build wheels. While it can obviously be used by > Windows developers who want to

Call for information - What assumptions can I make about Unix users' access to Windows?

2014-11-07 Thread Paul Moore
I'm in the process of developing an automated solution to allow users to quickly set up a Windows box so that it can be used to compile Python extensions and build wheels. While it can obviously be used by Windows developers who want to quickly set up a box, my main target is Unix developers who wa

generating 2D bit array variants with specific algorythm

2014-11-07 Thread Robert Voigtländer
Hi, I need to generate all variants of a 2D array with variable dimension sizes which fit a specific rule. (up to 200*1000) The rules are: - Values are only 0 or 1 - the sum of each line bust be 1 - only valid results must be generated (generating all and only returning the valid results takes

bdist_rpm with --requires and version

2014-11-07 Thread thomas . lehmann
Hi, using the RPM build I wonder how I can require a certain version of another RPM like: Working: python setup.py bdist_rpm --requires=another-package But how to? ... python setup.py bdist_rpm --requires=another-package>=2.1 Of course this will generate a "=2.1" file which is of course not

Re: Understanding "help" command description syntax - explanation needed

2014-11-07 Thread William Ray Wing
On Nov 7, 2014, at 7:42 AM, Dave Angel wrote: > > Bob Martin Wrote in message: >> in 730867 20141107 093651 c...@isbd.net wrote: >>> Darren Chen wrote: >>>> 在 >>>> 2014å¹´11月5日星期三UTC+8下午8时17分11秒,larry@gmail.com写道ï

Re: Understanding "help" command description syntax - explanation needed

2014-11-07 Thread Larry Martell
On Fri, Nov 7, 2014 at 7:52 AM, Steven D'Aprano wrote: > Dave Angel wrote: > >> Approximately 1968 for me. I wrote programs in 1967, but didn't >> get to run them till 1968. > > > I once used a compiler that slow too. Yeah, I think it was made by Intermetrics. Or maybe Borland. -- https://mail.

Re: [Python-Dev] Dinamically set __call__ method

2014-11-07 Thread Ethan Furman
On 11/06/2014 10:59 PM, dieter wrote: John Ladasky writes: On Tuesday, November 4, 2014 11:12:31 AM UTC-8, Ethan Furman wrote: If you really absolutely positively have to have the signature be correct for each instance, you may to either look at a function creating factory, a class creating f

Re: Understanding "help" command description syntax - explanation needed

2014-11-07 Thread Steven D'Aprano
Dave Angel wrote: > Approximately 1968 for me. I wrote programs in 1967, but didn't > get to run them till 1968. I once used a compiler that slow too. -- Steven -- https://mail.python.org/mailman/listinfo/python-list

Re: Understanding "help" command description syntax - explanation needed

2014-11-07 Thread Dave Angel
Bob Martin Wrote in message: > in 730867 20141107 093651 c...@isbd.net wrote: >>Darren Chen wrote: >>> 在 >>> 2014年11月5日星期三UTC+8下午8时17分11秒,larry@gmail.com写道: >>> > On Wed, Nov 5, 2014 at 7:13 AM, Ivan Evstegneev >&g

Python @ FOSDEM 2015 - Call For Proposals

2014-11-07 Thread Stéphane Wirtel
* Please forward this CfP to anyone who may be interested in participating. * Hi all, This is the official call for sessions for the `Python Devroom` at `FOSDEM 2015` . FOSDEM is the Free and Open source Software Developers' European Meeting, a free and non-commercial two-day week-end that

Re: Understanding "help" command description syntax - explanation needed

2014-11-07 Thread Bob Martin
in 730867 20141107 093651 c...@isbd.net wrote: >Darren Chen wrote: >> 在 >> 2014年11月5日星期三UTC+8下午8时17分11秒,larry@gmail.com写道: >> > On Wed, Nov 5, 2014 at 7:13 AM, Ivan Evstegneev >> > wrote: >> > > Firtst of

Re: Understanding "help" command description syntax - explanation needed

2014-11-07 Thread cl
Darren Chen wrote: > 在 2014年11月5日星期三UTC+8下午8时17分11秒,larry@gmail.com写道: > > On Wed, Nov 5, 2014 at 7:13 AM, Ivan Evstegneev > > wrote: > > > Firtst of all thanks for reply. > > > > > >>>brackets [] means that the argument is optional. > > > > > > That's what I'm talking about (asking actually

Re: Python has arrived!

2014-11-07 Thread Gregory Ewing
Steve Hayes wrote: On Thu, 6 Nov 2014 15:22:45 + (UTC), Grant Edwards wrote: According to http://www.theregister.co.uk/2014/11/06/hackers_use_gmail_drafts_as_dead_drops_to_control_malware_bots: 404: Page not found Works if you remove the spurious colon from the end of the url. -- Gre

Re: Python has arrived!

2014-11-07 Thread Heinz Schmitz
Steve Hayes wrote: >>According to >>http://www.theregister.co.uk/2014/11/06/hackers_use_gmail_drafts_as_dead_drops_to_control_malware_bots: >> >> "Attacks occur in two phases. Hackers first infect a targeted >> machine via simple malware that installs Python onto the device, >> [...]" >[Fri

Re: Python has arrived!

2014-11-07 Thread Steve Hayes
On Thu, 6 Nov 2014 15:22:45 + (UTC), Grant Edwards wrote: >According to >http://www.theregister.co.uk/2014/11/06/hackers_use_gmail_drafts_as_dead_drops_to_control_malware_bots: > > "Attacks occur in two phases. Hackers first infect a targeted > machine via simple malware that installs Pyt