Skip to main content
Rollback to Revision 5
Source Link
jpmc26
  • 29.8k
  • 8
  • 78
  • 118

This specific situation

This specific situation

The kind of answer I would expect

The kind of answer I would expect

The problem

The problem

Generalizing

Generalizing

The question: What does SO (the company) expect us to do about these kinds of situations?

The question: What does SO (the company) expect us to do about these kinds of situations?

This specific situation

The kind of answer I would expect

The problem

Generalizing

The question: What does SO (the company) expect us to do about these kinds of situations?

This specific situation

The kind of answer I would expect

The problem

Generalizing

The question: What does SO (the company) expect us to do about these kinds of situations?

added 10 characters in body
Source Link
Robert Harvey
  • 180.6k
  • 55
  • 267
  • 319

This specific situation

This specific situation

The kind of answer I would expect

The kind of answer I would expect

The problem

The problem

Generalizing

Generalizing

The question: What does SO (the company) expect us to do about these kinds of situations?

The question: What does SO (the company) expect us to do about these kinds of situations?

This specific situation

The kind of answer I would expect

The problem

Generalizing

The question: What does SO (the company) expect us to do about these kinds of situations?

This specific situation

The kind of answer I would expect

The problem

Generalizing

The question: What does SO (the company) expect us to do about these kinds of situations?

added 77 characters in body
Source Link
jpmc26
  • 29.8k
  • 8
  • 78
  • 118
  • In the comments, you can see that they're not familiar with the differences between the binary (bytes) and text (str) types and how to convert between them (the decode call I mentioned above):

    the error i faced when i used read() . 'if files in f1.read():TypeError: a bytes-like object is required, not 'str' ' . r = f1.readlines() returns a list and i am not able to find a way to find a string in that list

  • They don't grasp that the in operator does not perform a contains check on each element of the list, but rather performs an equality check against each element. This is evidenced by the fact they need assistance, rather than solving the problem themselves.

  • Given that they are not familiar with the differences between binary and text types, it is also highly likely they are not familiar with text encodings and the issues surrounding them. They must learn about this topic to determine the correct encoding to apply.

  • There is also a concern with respect to styles of newlines. It's not clear if they wish to normalize the newlines, consider differences, or disallow the search string from containing them, which would allow them to be ignored. That they did not include information about this detail suggests they may not be aware of these issues, either.

  • The accepted answer was also wrong at the time it was accepted. It converted the list of lines into the repr, which formats the list into a literal expression (including the list brackets, quote marks, and escape sequences). That the asker did not recognize this also indicates they are missing knowledge about str and how it behaves on lists.

  • In the comments, you can see that they're not familiar with the differences between the binary (bytes) and text (str) types and how to convert between them (the decode call I mentioned above):

    the error i faced when i used read() . 'if files in f1.read():TypeError: a bytes-like object is required, not 'str' ' . r = f1.readlines() returns a list and i am not able to find a way to find a string in that list

  • They don't grasp that the in operator does not perform a contains check on each element of the list, but rather performs an equality check against each element. This is evidenced by the fact they need assistance, rather than solving the problem themselves.

  • Given that they are not familiar with the differences between binary and text types, it is also highly likely they are not familiar with text encodings and the issues surrounding them.

  • There is also a concern with respect to styles of newlines. It's not clear if they wish to normalize the newlines, consider differences, or disallow the search string from containing them, which would allow them to be ignored. That they did not include information about this detail suggests they may not be aware of these issues, either.

  • The accepted answer was also wrong at the time it was accepted. It converted the list of lines into the repr, which formats the list into a literal expression (including the list brackets, quote marks, and escape sequences). That the asker did not recognize this also indicates they are missing knowledge about str and how it behaves on lists.

  • In the comments, you can see that they're not familiar with the differences between the binary (bytes) and text (str) types and how to convert between them (the decode call I mentioned above):

    the error i faced when i used read() . 'if files in f1.read():TypeError: a bytes-like object is required, not 'str' ' . r = f1.readlines() returns a list and i am not able to find a way to find a string in that list

  • They don't grasp that the in operator does not perform a contains check on each element of the list, but rather performs an equality check against each element. This is evidenced by the fact they need assistance, rather than solving the problem themselves.

  • Given that they are not familiar with the differences between binary and text types, it is also highly likely they are not familiar with text encodings and the issues surrounding them. They must learn about this topic to determine the correct encoding to apply.

  • There is also a concern with respect to styles of newlines. It's not clear if they wish to normalize the newlines, consider differences, or disallow the search string from containing them, which would allow them to be ignored. That they did not include information about this detail suggests they may not be aware of these issues, either.

  • The accepted answer was also wrong at the time it was accepted. It converted the list of lines into the repr, which formats the list into a literal expression (including the list brackets, quote marks, and escape sequences). That the asker did not recognize this also indicates they are missing knowledge about str and how it behaves on lists.

Second iteration.
Source Link
Peter Mortensen
  • 31.6k
  • 4
  • 22
  • 14
Loading
Active reading [<https://en.wiktionary.org/wiki/gobbledygook#Noun> <https://en.wiktionary.org/wiki/expectation#Noun>].
Source Link
Peter Mortensen
  • 31.6k
  • 4
  • 22
  • 14
Loading
added 165 characters in body; added 80 characters in body
Source Link
jpmc26
  • 29.8k
  • 8
  • 78
  • 118
Loading
Source Link
jpmc26
  • 29.8k
  • 8
  • 78
  • 118
Loading