In <[EMAIL PROTECTED]>, Andy wrote:

> Gurus, I'm looking for definite examples (pardon me if I'm not clear
> here) on Stack class...Somewhat like this :
> 
> class Stack(object):
>       def __init__(self__)
>           self.__contents = []

I don't know what to tell you here without writing the thing for you.  Ask
yourself what operations a `Stack` needs and look at the documentation for
`list` operations.  It's pretty easy to map the stack operations to `list`
ones.

> and ad hoc implementation of a class based on number system like for
> example somewhat like this
> 
> 
> def __imult__(self, other):
>        self.__numerator   *= other.__numerator
>        self.__denominator *= other.__denominator
>        .
>        .
>       return self

So what exactly is your problem?  Take a "number like", look at the
methods it implements and do this for your "number like" class.

> I'm not satisfied with Python Docs.

Why?  What does `Emulating numeric types`_ in the reference manual lack in
your opinion?

.. _Emulating numeric types: http://docs.python.org/ref/numeric-types.html

Ciao,
        Marc 'BlackJack' Rintsch
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to