-5

What mean in python when i'm after function set [::-1] or [:64] for example? Here is code example

var = binascii.unhexlify(data)[:64]
Zulu
  • 8,765
  • 9
  • 49
  • 56
lebron2323
  • 990
  • 2
  • 14
  • 29
  • 1
    http://stackoverflow.com/questions/509211/pythons-slice-notation – FuriousGeorge Jan 21 '14 at 19:49
  • 3
    Or you could just read the [Informal Introduction](http://docs.python.org/3/tutorial/introduction.html#strings) chapter that kicks off the tutorial, which covers slices half-way down the page. And presumably any other source for learning Python (short of just hacking at code you don't understand and then asking random strangers to explain things to you when it doesn't seem to work) will cover it about as early. – abarnert Jan 21 '14 at 19:52

1 Answers1

3

binascii.unhexlify returns a string. The brackets are applied to that object, not the function. It is just a short version of

x = binascii.unhexlify(data)
var = x[:64]
chepner
  • 497,756
  • 71
  • 530
  • 681