I read a following sentence in the book Data Structure & Algorithm in Python(Page 412):

To begin, we note that, for any data type X that is represented using at most as many bits as our integer hash codes, we can simply take as a hash code for X an integer interpretation of its bits.

What I have seen sentence forms about take as, as follows:

  • A is taken as B. For example: The shape of heart is taken as love.
  • subject take A as B. For example: Jim takes her gift as kindness.

However the phrase take as ... in the context, there are two noun phrases joined together, So I have a little of confusion. Here is my understanding:

  • we can simply take an integer interpretation of its bit as a hash code for X.

Am I right?

  • 1
    Your interpretation is absolutely correct. It appears that you do not need our assistance! – P. E. Dant Reinstate Monica Jun 25 '17 at 7:11
  • thanks. I have not ever seen this type of usage of "take as noun.1 + noun.2". Is the interpretation of "take noun.2 as noun.1" fixed? – Jesse Jun 25 '17 at 7:15
  • I don't know what you mean by "fixed" here. Your understanding of the "take sth as sth’" structure is excellent, though. – P. E. Dant Reinstate Monica Jun 25 '17 at 7:25
  • That is say, if I want to write a similar sentence whose meaning is the same as "Jim take her gift as kindness", I could write like this: "Jim take as kindness her gift, or "Jim take as her gift kindness, which one is more suitable? – Jesse Jun 25 '17 at 7:33
  • @Jesse In a short sentence like this, we would only use the first word order. (Jim takes her gift as kindness.) – BobRodes Jun 25 '17 at 8:38

You are, as P.E. Dant has said, quite clear on the meaning of this. The reason that you are seeing the unusual word order in the Python book is because that word order is sometimes clearer when you have more complex concepts that are being equated using take as. Between the take and the as, you have to process the other potential meanings of take while you are going through the intervening noun phrase. If that noun phrase gets at all convoluted, that becomes difficult.

Suppose the book said this, for example:

We can simply take an interpretation of its bits as a signed integer encoded in two's complement as a hash code for X.

It takes some work to figure out which as goes with the take. This is clearer:

We can simply take as a hash code for X an interpretation of its bits as a signed integer encoded in two's complement.

Technical manuals have a lot of convoluted prose, and technical writers are generally quite happy to evolve their own conventions in the interest of clarity. It's rather the mindset of the engineer: engineers are always looking for ways to break rules in order to get things to work better. If something works better, it becomes a new rule, until superseded by a better one.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.