Designer Door Mat

  • + 0 comments

    I would only offer one alternative. Instead of pattern[::-1] consider list(reversed(pattern))

    Yes it is more verbose, but the intent is clearer. Particularly for developers who have to refactor (or at least understand) that code who also have to work in many languages and don't always catch nuances of each one.

    In data science, particular at companies that favor open source or very large companies with many "standard" products, a data scientist could be using a half dozen languages or more, so in that case "obvious" wins over "specialty".

    That being said, I usually prefer shorter code, so I can easily appreciate arguments for staying with [::-1].