The package is used when a relative dotted name is supplied to the
resolve() method. A dotted name
which has a . (dot) or : (colon) as its first character is
treated as relative.

If the value None is supplied as the package, the resolver will
only be able to resolve fully qualified (not relative) names. Any
attempt to resolve a relative name when the package is None will
result in an ValueError exception.

If a module or module name (as opposed to a package or package name)
is supplied as package, its containing package is computed and this
package used to derive the package name (all names are resolved relative
to packages, never to modules). For example, if the package argument
to this type was passed the string xml.dom.expatbuilder, and
.mindom is supplied to the
resolve() method, the resulting
import would be for xml.minidom, because xml.dom.expatbuilder is
a module object, not a package object.

If a package or package name (as opposed to a module or module name)
is supplied as package, this package will be used to relative compute
dotted names. For example, if the package argument to this type was
passed the string xml.dom, and .minidom is supplied to the
resolve() method, the resulting
import would be for xml.minidom.

This method resolves a dotted name reference to a global Python
object (an object which can be imported) to the object itself.

Two dotted name styles are supported:

pkg_resources-style dotted names where non-module attributes
of a package are separated from the rest of the path using a :
e.g. package.module:attr.

zope.dottedname-style dotted names where non-module
attributes of a package are separated from the rest of the path
using a . e.g. package.module.attr.

These styles can be used interchangeably. If the supplied name
contains a : (colon), the pkg_resources resolution
mechanism will be chosen, otherwise the zope.dottedname
resolution mechanism will be chosen.

If the dotted argument passed to this method is not a string, a
ValueError will be raised.

The package is used when a relative asset specification is supplied
to the resolve() method. An asset
specification without a colon in it is treated as relative.

If the value None is supplied as the package, the resolver will
only be able to resolve fully qualified (not relative) asset
specifications. Any attempt to resolve a relative asset specification
when the package is None will result in an ValueError
exception.

If a module or module name (as opposed to a package or package name)
is supplied as package, its containing package is computed and this
package used to derive the package name (all names are resolved relative
to packages, never to modules). For example, if the package argument
to this type was passed the string xml.dom.expatbuilder, and
template.pt is supplied to the
resolve() method, the resulting absolute
asset spec would be xml.minidom:template.pt, because
xml.dom.expatbuilder is a module object, not a package object.

If a package or package name (as opposed to a module or module name)
is supplied as package, this package will be used to compute relative
asset specifications. For example, if the package argument to this
type was passed the string xml.dom, and template.pt is supplied
to the resolve() method, the resulting
absolute asset spec would be xml.minidom:template.pt.

If spec is an absolute filename
(e.g. /path/to/myproject/templates/foo.pt) or an absolute asset
spec (e.g. myproject:templates.foo.pt), an asset descriptor is
returned without taking into account the package passed to this
class’ constructor.

If spec is a relative asset specification (an asset
specification without a : in it, e.g. templates/foo.pt), the
package argument of the constructor is used as the the package
portion of the asset spec. For example: