Bug report
Bug description:
# Add a code block here, if required
class L (list):
def __new__ (cls,value):
if isinstance(value,str):
if ',' in value:
collect = []
for item in value.split(','):
collect.append(item)
value = collect
return super().__new__(cls,value)
print(L("1,2"))
Expected output: ['1', '2']
Got instead: ['1', ',', '2']
If I don't cast the return value, I get the correct value but the type would not be what I want.
CPython versions tested on:
3.13
Operating systems tested on:
macOS