[Python-il] Fwd: Is there a Python module for handling Python object addresses?

cool-RR cool-rr at cool-rr.com
Sat Sep 11 21:41:11 IDT 2010


Hi Rani,

On Sat, Sep 11, 2010 at 7:56 PM, Rani Hod <rani.hod at gmail.com> wrote:

> 3. I'm making a GUI in which the user will be able to manipulate Python
>> functions, and I want to display the shortest name possible on the screen.
>>
>
> But this could lead to funny circumstances. Say that
>
>    - class Foo is defined in long_package_name/long_modulename.py
>    - long_package_name/__init__.py does
>    from long_module_name import Foo
>    - short_mod.py does
>    from long_package_name.long_module_name import Foo as Bar
>
> Technically, short_mod.Bar is shorter than long_package_name.Foo; will you
> prefer it?
>

Good question, that would indeed be bad to use short_mod.Bar as a name for
Foo. But the way I do my shortening does not allow  for something like this
to happen. (I have not mentioned this in my original message, sorry.) The
shortening can only remove components from the address. So an address like
a.b.c.d.e can be shortened to a.c.d.e or a.d.e but not x.y.z. So I think
this prevents these kinds of problems from happening.


Ram.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://hamakor.org.il/pipermail/python-il/attachments/20100911/39ea6216/attachment.htm 


More information about the Python-il mailing list