On 4/28/07, Max Ischenko <[EMAIL PROTECTED]> wrote:
> Hello,
>
> On 4/28/07, Robert Leftwich <[EMAIL PROTECTED]> wrote:
> >
> > No, but the Myghty code has:
> >
> > if type(component) == types.StringType:
> >     component = self.fetch_lead_component(component)
> > elif component.is_file_component():
> >     ...
>
>  I think the code is flawed and a patch should be filed. Something along the
> lines of
>
>  if isinstance(component, (str, unicode)):
>     component = self.fetch_lead_component(component)
>  Max.

The following is even better:

    if isinstance(component, basestring)

I think it's good policy to use Unicode objects all over the place
inside your app and then either call str or .encode "on the edges of
your application".  It seems to me that it's better to use str when
looking up the right component than it is to turn off unicode
completely.

My $0.02 (what's that in Australia?),
-jj

-- 
http://jjinux.blogspot.com/

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to