Re: PyWart: Module access syntax

2013-01-15 Thread Jean-Michel Pichavant
> > Please explain how this is a problem. As Steven said, there is NO > > > > useful difference. I don't *care* whether it's a package, a module, > > or > > > > whatever. Module with class with static member? Fine. Package with > > > > module with class? Also fine. Imported special object that u

Re: PyWart: Module access syntax

2013-01-15 Thread Chris Angelico
On Tue, Jan 15, 2013 at 6:49 PM, Rick Johnson wrote: > Look, maybe nobody has the time to deal with this module, so if you need some > help, then feel free to ask for my assistance. All Guido has to do is send me > a private email and say: > > """ Hello Rick! Your ideas for packaging of Tkinter

Re: PyWart: Module access syntax

2013-01-14 Thread Rick Johnson
On Monday, January 14, 2013 12:51:50 PM UTC-6, Ian wrote: > I think the distinction you are trying to make here is based upon the > submodule's actual source location on the disk. If you have a package > folder A which contains a file B.py, then you would access that as > A:B, correct? If on the

Re: PyWart: Module access syntax

2013-01-14 Thread Rick Johnson
On Monday, January 14, 2013 11:34:56 AM UTC-6, Steven D'Aprano wrote: > Since both os and path are modules, you here say that they need a colon > between them. This contradicts the above when you say the syntax for > os.path won't change. But you forgot the rule about accessing module members w

Re: PyWart: Module access syntax

2013-01-14 Thread Ian Kelly
On Mon, Jan 14, 2013 at 12:35 PM, D'Arcy J.M. Cain wrote: > On Mon, 14 Jan 2013 11:51:50 -0700 > Ian Kelly wrote: >> On Sun, Jan 13, 2013 at 10:22 PM, Rick Johnson >> wrote: > ...Whatever > >> If you want us to understand the syntax, then you need to define > > If you are going to feed the troll

Re: PyWart: Module access syntax

2013-01-14 Thread D'Arcy J.M. Cain
On Mon, 14 Jan 2013 11:51:50 -0700 Ian Kelly wrote: > On Sun, Jan 13, 2013 at 10:22 PM, Rick Johnson > wrote: ...Whatever > If you want us to understand the syntax, then you need to define If you are going to feed the trolls can I please ask that you Cc them or send to them and Cc the list? Tha

Re: PyWart: Module access syntax

2013-01-14 Thread Ian Kelly
On Mon, Jan 14, 2013 at 11:51 AM, Ian Kelly wrote: >> Because modules and objects are not the same and someone who is reading the >> source code NEEDS to know which "path members" are /modules/ and which "path >> members" are /objects/. And he needs to know that very important >> information W

Re: PyWart: Module access syntax

2013-01-14 Thread Ian Kelly
On Sun, Jan 13, 2013 at 10:22 PM, Rick Johnson wrote: > You are missing the point of this syntax. The colon is to access MODULE > NAMESPACE. The dot is to access MODULE MEMBERS. A module CAN BE another > module's MEMBER. > > You are also unable to grasp this simple logical fact: Once you arrive

Re: PyWart: Module access syntax

2013-01-14 Thread Steven D'Aprano
On Sun, 13 Jan 2013 21:22:57 -0800, Rick Johnson wrote: > On Saturday, January 12, 2013 12:45:03 AM UTC-6, Steven D'Aprano wrote: >> On Fri, 11 Jan 2013 20:34:20 -0800, Rick Johnson wrote: >> > [...] >> So what do you do for, say, os.path? According to the first rule, you >> must write it as os:pa

Re: PyWart: Module access syntax

2013-01-13 Thread Rick Johnson
On Saturday, January 12, 2013 12:45:03 AM UTC-6, Steven D'Aprano wrote: > On Fri, 11 Jan 2013 20:34:20 -0800, Rick Johnson wrote: > > [...] > So what do you do for, say, os.path? According to the first rule, you > must write it as os:path because path is a module; according to the > second rule,

Re: PyWart: Module access syntax

2013-01-12 Thread 88888 Dihedral
Chris Angelico於 2013年1月12日星期六UTC+8下午12時40分36秒寫道: > On Sat, Jan 12, 2013 at 3:34 PM, Rick Johnson > > wrote: > > > *The problem:* > > > ... is readability. The current dot syntax used ubiquitously in paths is > > not conveying the proper information to the reader, and in-fact obfuscating > > t

Re: PyWart: Module access syntax

2013-01-12 Thread Nicholas Cole
On Fri, Jan 11, 2013 at 6:01 AM, Rick Johnson wrote: > > Python's module/package access uses dot notation. > > mod1.mod2.mod3.modN > > Like many warts of the language, this wart is not so apparent when first > learning the language. The dot seems innocently sufficient, however, in > truth it is

Re: PyWart: Module access syntax

2013-01-11 Thread alex23
On 12 Jan, 14:34, Rick Johnson wrote: > If you don't know which names are modules and which names are members > then how could a programmer possibly use the API in an intelligent way Your initial argument is that with import's current dot notation, it's not obvious which is a module or not withou

Re: PyWart: Module access syntax

2013-01-11 Thread Ian Kelly
On Fri, Jan 11, 2013 at 9:34 PM, Rick Johnson wrote: > No the rules are: > * "Colon" must be used to access a "module" (or a package). > * "Dot" must be used to access a "module member". What about module a that does not natively contain module b, but imports it as a member like so? a.py

Re: PyWart: Module access syntax

2013-01-11 Thread Steven D'Aprano
On Fri, 11 Jan 2013 21:46:36 -0800, Rick Johnson wrote: > On Friday, January 11, 2013 10:40:36 PM UTC-6, Chris Angelico wrote: >> On Sat, Jan 12, 2013 at 3:34 PM, Rick Johnson > >> > *The problem:* >> > ... is readability. The current dot syntax used ubiquitously in paths >> > is not conveying th

Re: PyWart: Module access syntax

2013-01-11 Thread Steven D'Aprano
On Fri, 11 Jan 2013 20:34:20 -0800, Rick Johnson wrote: >> > import lib:gui:tkinter:dialogs.SimpleDialog as Blah >> >> Which names are packages, modules, classes, methods, functions, or >> other objects? >> >> Why do you have lib:gui but dialogs.SimpleDialog? Is the rule "classes >> should alw

Re: PyWart: Module access syntax

2013-01-11 Thread Chris Angelico
On Sat, Jan 12, 2013 at 4:46 PM, Rick Johnson wrote: > This is a matter of READABILITY, Christopher. It's one or the other (or the > status quo): > > 1. Enforce naming conventions. > 2. Enforce path syntax. > 3. Continue to duck type, like Python is good at. > > The choice is yours. FTFY. Chris

Re: PyWart: Module access syntax

2013-01-11 Thread Rick Johnson
On Friday, January 11, 2013 10:40:36 PM UTC-6, Chris Angelico wrote: > On Sat, Jan 12, 2013 at 3:34 PM, Rick Johnson > > *The problem:* > > ... is readability. The current dot syntax used ubiquitously in paths is > > not conveying the proper information to the reader, and in-fact obfuscating > >

Re: PyWart: Module access syntax

2013-01-11 Thread Chris Angelico
On Sat, Jan 12, 2013 at 3:34 PM, Rick Johnson wrote: > *The problem:* > ... is readability. The current dot syntax used ubiquitously in paths is not > conveying the proper information to the reader, and in-fact obfuscating the > code. Please explain how this is a problem. As Steven said, there

Re: PyWart: Module access syntax

2013-01-11 Thread Rick Johnson
On Friday, 1-11-2013 10:02:34 AM, Steven D'Aprano wrote: > Solution to what? You can only have a solution once you have identified a > problem. You have not identified a problem. In any case, your suggestion > is *not* obvious. The problem is that by using the dot ubiquitously we are obfuscatin

Re: PyWart: Module access syntax

2013-01-11 Thread Steven D'Aprano
On Thu, 10 Jan 2013 22:01:37 -0800, Rick Johnson wrote: > Python's module/package access uses dot notation. > > mod1.mod2.mod3.modN > > Like many warts of the language, this wart is not so apparent when first > learning the language. The dot seems innocently sufficient, however, in > truth it