Use company name for module

2010-11-12 Thread Micah Carrick
My company is working on releasing some of our code as open-source python
modules. I don't want my "foo" module conflicting with other modules called
"foo" on PyPi or github or a user's system. Is there anything wrong, from a
conventions standpoint, with having modules like company.foo and company.bar
even if foo and bar are not necessarily related other than being released by
us? I really don't like the cryptic module names or things like foo2 and the
like.

-- 
Micah Carrick - http://www.micahcarrick.com
-- 
http://mail.python.org/mailman/listinfo/python-list


Objects versus dictionaries

2010-11-14 Thread Micah Carrick
I'm writing a little API that other people will use. There are up to 3
"objects" that get passed around. One of them has some validation methods,
the other two simply store data and probably won't have any validation or
other methods. I only made them objects so that they are syntactically (is
that a word?) similar the other object rather than using dictionaries. I
figure it also better allows for changes in the future.

Any thoughts on the pros/cons of using my own objects over a dictionary
objects?

# this is what I have now...
stuff = Stuff(foo="foo", bar="bar")
if stuff.is_valid():
  cust = Customer(name="John", email="f...@bar.com")
  order = Order(order_id=1234, amount=12.99)
  SomeObject.some_method(stuff, cust, order)

# this would also work...
stuff = Stuff(foo="foo", bar="bar")
if stuff.is_valid():
  cust = { 'name': "John", 'email': "f...@bar.com" }
  order = { 'order_id': 1234, 'amount': 12.99 }
  SomeObject.some_method(stuff, cust, order)

-- 
Micah Carrick
-- 
http://mail.python.org/mailman/listinfo/python-list