Michael Spencer wrote:
> >>> class A(object):
> ...
> >>> b = object.__new__(A)
Note that you'll need to be a bit cleverer if the
class might be derived from some other built-in
type:
>>> class A(list):
... pass
...
>>> b = object.__new__(A)
Traceback (most recent call last):
File "", li
Michael Spencer wrote:
> Devan L wrote:
> > Is there any safe way to create an instance of an untrusted class
> > without consulting the class in any way? With old-style classes, I can
> > recreate an instance from another one without worrying about malicious
> > code (ignoring, for now, malicious
Devan L wrote:
> Is there any safe way to create an instance of an untrusted class
> without consulting the class in any way? With old-style classes, I can
> recreate an instance from another one without worrying about malicious
> code (ignoring, for now, malicious code involving attribute access)
Ben Finney wrote:
> "Devan L" <[EMAIL PROTECTED]> writes:
>
> > Is there any safe way to create an instance of an untrusted class
>
> Why are you instantiating classes you don't trust?
>
> > without consulting the class in any way?
> If you don't "consult the class", how can the instance be created
"Devan L" <[EMAIL PROTECTED]> writes:
> Is there any safe way to create an instance of an untrusted class
Why are you instantiating classes you don't trust?
> without consulting the class in any way?
If you don't "consult the class", how can the instance be created
properly?
--
\ "It's