En Wed, 31 Aug 2011 22:28:09 -0300, Travis Parks jehugalea...@gmail.com
escribió:
On Aug 31, 7:37 pm, Gregory Ewing greg.ew...@canterbury.ac.nz wrote:
Ian Kelly wrote:
if sys.version_info (3,):
getDictValues = dict.itervalues
else:
getDictValues = dict.values
(which is
On Sep 2, 12:36 pm, Gabriel Genellina gagsl-...@yahoo.com.ar
wrote:
En Wed, 31 Aug 2011 22:28:09 -0300, Travis Parks jehugalea...@gmail.com
escribi :
On Aug 31, 7:37 pm, Gregory Ewing greg.ew...@canterbury.ac.nz wrote:
Ian Kelly wrote:
if sys.version_info (3,):
getDictValues =
On 9/2/2011 12:53 PM, Travis Parks wrote:
On Sep 2, 12:36 pm, Gabriel Genellinagagsl-...@yahoo.com.ar
Those if/else are at global scope. An 'if' statement does not introduce a
new scope; so getDictValues, despite being indented, is defined at
global scope, and may be used anywhere in the
En Fri, 02 Sep 2011 13:53:37 -0300, Travis Parks jehugalea...@gmail.com
escribió:
On Sep 2, 12:36 pm, Gabriel Genellina gagsl-...@yahoo.com.ar
wrote:
En Wed, 31 Aug 2011 22:28:09 -0300, Travis Parks
jehugalea...@gmail.com escribi :
On Aug 31, 7:37 pm, Gregory Ewing
Am 31.08.2011 03:43, schrieb Travis Parks:
I am writing a simple algorithms library that I want to work for both
Python 2.7 and 3.x. I am writing some functions like distinct, which
work with dictionaries under the hood. The problem I ran into is that
I am calling itervalues or values
On Wed, Aug 31, 2011 at 3:55 AM, Martin v. Loewis mar...@v.loewis.de wrote:
if sys.version_info (3,):
def getDictValues(dict):
return dict.itervalues()
else:
def getDictValues(dict):
return dict.values()
The extra level of function call indirection is unnecessary here.
Better
Ian Kelly wrote:
if sys.version_info (3,):
getDictValues = dict.itervalues
else:
getDictValues = dict.values
(which is basically what the OP was doing in the first place).
And which he seemed to think didn't work for some
reason, but it seems fine as far as I can tell:
Python 2.7
On Aug 31, 7:37 pm, Gregory Ewing greg.ew...@canterbury.ac.nz wrote:
Ian Kelly wrote:
if sys.version_info (3,):
getDictValues = dict.itervalues
else:
getDictValues = dict.values
(which is basically what the OP was doing in the first place).
And which he seemed to think
I am writing a simple algorithms library that I want to work for both
Python 2.7 and 3.x. I am writing some functions like distinct, which
work with dictionaries under the hood. The problem I ran into is that
I am calling itervalues or values depending on which version of the
language I am working
On 8/30/2011 9:43 PM, Travis Parks wrote:
I am writing a simple algorithms library that I want to work for both
Python 2.7 and 3.x. I am writing some functions like distinct, which
work with dictionaries under the hood. The problem I ran into is that
I am calling itervalues or values depending
10 matches
Mail list logo