# Copyright 2014 Brett Slatkin, Pearson Education Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Preamble to mimick book environment
import logging
from pprint import pprint
from sys import stdout as STDOUT
# Example 12
from mypackage import *
a = Projectile(1.5, 3)
b = Projectile(4, 1.7)
after_a, after_b = simulate_collision(a, b)
print(after_a.__dict__, after_b.__dict__)
import mypackage
try:
mypackage._dot_product
assert False
except AttributeError:
pass # Expected
mypackage.utils._dot_product # But this is defined
--------------------------------------------------------------------------- ImportError Traceback (most recent call last) <ipython-input-2-f6592d4ef03a> in <module>() 1 # Example 12 ----> 2 from mypackage import * 3 4 a = Projectile(1.5, 3) 5 b = Projectile(4, 1.7) ImportError: No module named 'mypackage'