Q:

(Unexpected) TypeError while using setworldcoordinates()

I'm trying to create a canvas using Tkinter with a customized coordinates to be used in Turtle Graphics. The method setworldcoordinates() takes in four parameters and I did it as usual. Not sure why there is a TypeError here.
from tkinter import *
import turtle

master = Tk()
cv = Canvas(master, width = 200, height = 200)
screen = turtle.TurtleScreen(cv)

screen.setworldcoordinates(-50, -50, 50, 50)

This is the error message that I got:
Traceback (most recent call last):
  File "(file path)\temp.py", line 8, in <module>
    screen.setworldcoordinates(-50, -50, 50, 50)
  File "(file path)\turtle.py", line 1095, in setworldcoordinates
    self.screensize(wx-20, wy-20)
TypeError: unsupported operand type(s) for -: 'str' and 'int'

A:

After digging in source code I found that it uses different methods to get Canvas's size. 
If Canvas is not embedded in window (not attached to layout/geometry manager) then it uses    
cv['width'], cv['height'] 

which gives size as strings.
If Canvas is embed in window then it uses 
cv.winfo_width(), cv.winfo_height()

which gives size as numbers
You have to use i.e.
cv.pack()

or
cv.grid()

to resolve problem.
But it will not work with cv.place()
from tkinter import *
import turtle

master = Tk()

cv = Canvas(master, width=200, height=200)
cv.pack() # <-- solution

screen = turtle.TurtleScreen(cv)

screen.setworldcoordinates(-50, -50, 50, 50)

