I am curious to know how python internally handles the type casting of tuple to a list. For example,
>>> list((1,2,3))
[1, 2, 3]
Does it internally calls a for loop to add it to a list or its merely a type conversion.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Python doesn’t have “type casting”. The iterable is passed to the
listinitializer, which delegates it to theextend()method.