a strange question in it.comp.lang...

6e6op 6e6op at excite.it
Thu Jan 9 05:42:34 EST 2003


thanks!
so the only way to do that is: take the src of the interpreter and
change str object code... too much work.. the man that did it
builded ruby ;-)) (i'm joking)

i'm thinking...
the possibility to change the
core classes (obviously not __builtins__= __mybuiltins__ )
in some way can be useful to build a customized python,
maybe for embedded system or
for application like java midlet used in new mobile phones...
or things like that.

not really a new platform.. i want to try an example to explain..
the X Company build a new periferal with a mini linux embedded,
with a short list of command and only c++ to implement application.
a customized python, in this case can be the way to build application
better and quickly than c++ for the X Company...

.. it's only an idea

:)
--
Francesco Contini


----- Original Message -----
From: "holger krekel" <pyth at devel.trillke.net>
To: "6e6op" <6e6op at excite.it>
Cc: <python-list at python.org>
Sent: Wednesday, January 08, 2003 8:17 PM
Subject: Re: a strange question in it.comp.lang...


> 6e6op wrote:
> > this is (more or less) the translation
> >
> > From: "Matteo Bertini" <m.bertini at tin.it>
> > Newsgroups: it.comp.lang
> > Sent: Sunday, January 05, 2003 11:26 PM
> > Subject: [PYTHON] estendere tipi di base
> >
> >
> > > I can build a class in this way:
> > >
> > > class mystring(str):
> > >      def is_email(self):
> > >          return self.find("@")
> > >
> > > use it in:
> > >
> > > mystring("pippo at pippo.it").is_email()
> > >
> > > the answer is, can i define mystring to be the default string class?
> > > can i ''validate''  "pippo".is_email() ?
> > > maybe is not goot, but is only curiosity.
> > >
> > > thanks,
> > > Matteo
> >
> > ok, then one answer jump in my brain:
> > there's a "place" where the interpreter load the __builtins__  package?
> > obviously __builtins__.str cannot be substitute with a customized one
after
> > the __builtins__ load ,
> > but before load?
>
> This wouldn't help (and you probably mean __builtin__, btw.).
>
> The construction of a string object doesn't involve a lookup
> of the builtin namespace.  'str' is just a convenient (builtin)
> way to get to the string type.
>
> > if the interpreter load __builtins__ in some place i can translate
> > __builtins__.str
> > with a __builtins__.mystr before that interpreter load __builtins__
> >
> > is it possible?
>
> no.
>
> cheers,
>
>     holger






More information about the Python-list mailing list