(original) (raw)
On Thu, May 9, 2013 at 7:17 AM, Nick Coghlan <ncoghlan@gmail.com> wrote:
+1\. This is a good one. While adding module=\_\_name\_\_ is actually more typing than passing \_\_name\_\_ + '.Color' as the class name, the current proposal (parsing for dots) makes it very attractive to do the wrong thing and hardcode the module name. Then typing the module incorrectly is very easy, and the mistake is easily overlooked because it won't be noticed until you actually try to pickle a member.
As Eric noted on the tracker issue, a keyword only "module" argument may be a better choice for both than allowing dotted names. A separate parameter is easier to use with __name__ to avoid hardcoding the module name.
+1\. This is a good one. While adding module=\_\_name\_\_ is actually more typing than passing \_\_name\_\_ + '.Color' as the class name, the current proposal (parsing for dots) makes it very attractive to do the wrong thing and hardcode the module name. Then typing the module incorrectly is very easy, and the mistake is easily overlooked because it won't be noticed until you actually try to pickle a member.
At the very least, the PEP should provide a rationale for the current choice.
Cheers,
Nick.>
\> Eli
\>
\>
\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/guido%40python.org
--
--Guido van Rossum (python.org/\~guido)