[python] Pulnocni rozjimani :-)

Bystroushaak bystrousak na kitakitsune.org
Pátek Březen 31 13:33:59 CEST 2017


Moje oblíbené:

 >>> a = []
 >>> a.append(a)
 >>> a
[[...]]
 >>> a[0]
[[...]]
 >>> a[0][0]
[[...]]
 >>> a[0][0][0]
[[...]]

Dne 10.5.2015 v 01:05 Vladimir Macek napsal(a):
> Just having fun.
>
>      $ python
>      >>> a = {}
>      >>> b = {'a': a}
>      >>> a['b'] = b
>      >>> a
>      {'b': {'a': {...}}}
>      >>> b
>      {'a': {'b': {...}}}
>      >>> import cPickle
>      >>> ap = cPickle.dumps(a)
>      >>> del a, b
>      >>> len(ap)
>      26
>      >>> a = cPickle.loads(ap)
>      >>> a
>      {'b': {'a': {...}}}
>      >>> a['b']
>      {'a': {'b': {...}}}
>      >>> a['b']['a']
>      {'b': {'a': {...}}}
>      >>> a['b']['a']['b']
>      {'a': {'b': {...}}}
>      >>>
>
> Navaze nekdo? :-)
>
> V.
>
>
> --- news://freenews.netfront.net/ - complaints: news na netfront.net ---
>



Další informace o konferenci Python