On 14/11/2011 10:05, Matej Cepl wrote:
Dne 11.11.2011 14:31, macm napsal(a):
def Dicty( dict[k1][k2] ):
When looking at this I returned to the question which currently rolls in
my mind:
What's difference/advantage-disadvantage betweeng doing multi-level
dicts/arrays like this and using tuple
Dne 11.11.2011 14:31, macm napsal(a):
def Dicty( dict[k1][k2] ):
When looking at this I returned to the question which currently rolls in
my mind:
What's difference/advantage-disadvantage betweeng doing multi-level
dicts/arrays like this and using tuple as a key? I.e., is it more
Pythonic
On Nov 11, 11:31 pm, macm wrote:
>
> I pass a nested dictionary to a function.
>
> def Dicty( dict[k1][k2] ):
> print k1
> print k2
>
> There is a fast way (trick) to get k1 and k2 as string.
It might be possible to do something using a reverse dictionary and
getting rid of the ne
On Nov 11, 11:31 pm, macm wrote:
>
> I pass a nested dictionary to a function.
>
> def Dicty( dict[k1][k2] ):
> print k1
> print k2
>
> There is a fast way (trick) to get k1 and k2 as string.
It might be possible to do something using a reverse dictionary and
getting rid of the ne
In Gelonida N
writes:
> > > There is a fast way (trick) to get k1 and k2 as string.
> > >
> > > Whithout loop all dict. Just it!
> If my guessing was correct is this what you are looking for?
He said he didn't want to loop over the dict contents. Without
that, I don't think there's an answe
On 11/11/2011 02:31 PM, macm wrote:
> > Hi Folks
> >
> > I pass a nested dictionary to a function.
> >
> > def Dicty( dict[k1][k2] ):
> > print k1
> > print k2
> >
> > There is a fast way (trick) to get k1 and k2 as string.
> >
> > Whithout loop all dict. Just it!
> >
> > Regards
> >
> > ma
On 11/11/2011 02:31 PM, macm wrote:
> Hi Folks
>
> I pass a nested dictionary to a function.
>
> def Dicty( dict[k1][k2] ):
> print k1
> print k2
>
> There is a fast way (trick) to get k1 and k2 as string.
>
> Whithout loop all dict. Just it!
>
> Regards
>
> macm
I think the ans
On Nov 11, 2:25 pm, John Gordon wrote:
> In <8f5215a8-d08f-4355-a5a2-77fcaa32c...@j10g2000vbe.googlegroups.com> macm
> writes:
>
> > I pass a nested dictionary to a function.
> > def Dicty( dict[k1][k2] ):
>
> That's not valid syntax.
>
> > print k1
> > print k2
> > There is a fast way (tr
In macm
writes:
> >>> myDict = {}
> >>> myDict['foo'] = {}
> >>> myDict['foo']['bar'] = 'works'
> -
> >>> def myFunction( MyObj ):
> ... # MyObj is a nested dicionary (normaly 2 steps like myDict['foo']
> ['bar'])
> ... # I want inspect this MyObj
> ... # what keys was pass
> ...
On 11/11/2011 11:33 AM, macm wrote:
Hi
Sorry ! My mistake.
myDict = {}
myDict['foo'] = {}
myDict['foo']['bar'] = 'works'
-
def myFunction( MyObj ):
... # MyObj is a nested dicionary (normaly 2 steps like myDict['foo']
['bar'])
No, it's not. It's a string "works". There's no di
Ok Sorry!!
Sorry the noise!!
def func(object):
print "%s" % object
Regards
On Nov 11, 2:33 pm, macm wrote:
> Hi
>
> Sorry ! My mistake.
>
> >>> myDict = {}
> >>> myDict['foo'] = {}
> >>> myDict['foo']['bar'] = 'works'
>
> -
>
> >>> def myFunction( MyObj ):
>
> ... # MyObj is a
Hi
Sorry ! My mistake.
>>> myDict = {}
>>> myDict['foo'] = {}
>>> myDict['foo']['bar'] = 'works'
-
>>> def myFunction( MyObj ):
... # MyObj is a nested dicionary (normaly 2 steps like myDict['foo']
['bar'])
... # I want inspect this MyObj
... # what keys was pass
... print M
In <8f5215a8-d08f-4355-a5a2-77fcaa32c...@j10g2000vbe.googlegroups.com> macm
writes:
> I pass a nested dictionary to a function.
> def Dicty( dict[k1][k2] ):
That's not valid syntax.
> print k1
> print k2
> There is a fast way (trick) to get k1 and k2 as string.
Are you stating t
On Nov 11, 1:31 pm, macm wrote:
> Hi Folks
>
> I pass a nested dictionary to a function.
>
> def Dicty( dict[k1][k2] ):
> print k1
> print k2
>
> There is a fast way (trick) to get k1 and k2 as string.
>
> Whithout loop all dict. Just it!
>
> Regards
>
> macm
I've tried to underst
14 matches
Mail list logo