MCPcopy Index your code
hub / github.com/python/cpython / __init__

Method __init__

Lib/tkinter/__init__.py:4344–4358  ·  view source on GitHub ↗
(self, imgtype, name=None, cnf={}, master=None, **kw)

Source from the content-addressed store, hash-verified

4342 _last_id = 0
4343
4344 def __init__(self, imgtype, name=None, cnf={}, master=None, **kw):
4345 self.name = None
4346 if master is None:
4347 master = _get_default_root('create image')
4348 self.tk = getattr(master, 'tk', master)
4349 if not name:
4350 Image._last_id += 1
4351 name = "pyimage%r" % (Image._last_id,) # tk itself would use image<x>
4352 if kw and cnf: cnf = _cnfmerge((cnf, kw))
4353 elif kw: cnf = kw
4354 options = ()
4355 for k, v in cnf.items():
4356 options = options + ('-'+k, v)
4357 self.tk.call(('image', 'create', imgtype, name,) + options)
4358 self.name = name
4359
4360 def __str__(self): return self.name
4361

Callers

nothing calls this directly

Calls 4

_get_default_rootFunction · 0.85
_cnfmergeFunction · 0.85
itemsMethod · 0.45
callMethod · 0.45

Tested by

no test coverage detected