Skip to content

str.join accepts non-strings #34

Open
@tusharsadhwani

Description

@tusharsadhwani
x = 1
y = 2
print(" + ".join([x, y]))

Should error out but doesn't:

$ python asd.py     
Traceback (most recent call last):
  File "/Users/tusharsadhwani/code/interpreted/asd.py", line 3, in <module>
    print(" + ".join([x, y]))
          ^^^^^^^^^^^^^^^^^^
TypeError: sequence item 0: expected str instance, int found

$ interpreted asd.py
1 + 2

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions