there is actually an issue here. since Codewars moved away from concatenating the user's solution and the tests for Python, whatever renaming and imports the user makes should stay contained within the solution module. however, because the Python tests suite does not explicitely import the user's function in this kata, Codewars inserts from solution import * to the tests for backwards-compatibility. alphanumeric should be imported explicitely instead; raising an issue about that
Suggest adding test cases for the literal strings "null", "nil", "none", etc; I see at least one solution that improperly returns that these are not alphanumeric (they are)
forbidding things is very hard in Python; the language is very dynamic and there are many, many ways to bypass naive restrictions
this kata is old (more than 11 years old...) and overranked. there has been a rank deflation on Codewars over time, and unfortunately ranks cannot be changed
Requiring a regex and moving to 6 kyu would be more appropriate for Python.
Python: missing
in the sample tests and full tests
there is actually an issue here. since Codewars moved away from concatenating the user's solution and the tests for Python, whatever renaming and imports the user makes should stay contained within the
solution
module. however, because the Python tests suite does not explicitely import the user's function in this kata, Codewars insertsfrom solution import *
to the tests for backwards-compatibility.alphanumeric
should be imported explicitely instead; raising an issue about thatthe reason your code fails is because you overwrite
str
in your import linethis means
str
is no longer what it should be in the Python code,and so that breaks the tester
this is why you should never overwrite a built-in function, a module name, or a keyword, et cetera
first, you should use a spoiler flag if you post code
I added the flag to your comment
This comment is hidden because it contains spoiler information about the solution
Suggest adding test cases for the literal strings "null", "nil", "none", etc; I see at least one solution that improperly returns that these are not alphanumeric (they are)
Rust's
test
andattempt
give error:unresolved import super::alphanumeric
solution in 1 string :0
I appreciate your response a lot! Thanks!
This comment is hidden because it contains spoiler information about the solution
It's more like a 7 kyu.
Much too easy for 5 kyu!
Why should they be false?
Loading more items...