djthyrax Posted November 20, 2007 at 03:31 PM Report Share #148896 Posted November 20, 2007 at 03:31 PM Gostava de saber se é possível extender uma class já existente. Por exemplo, numa string (a class é a string), temos o método split(). Como posso acrescentar mais métodos a todas as strings (tipo, "asdfasdf".lolar("oi"))? Não peças ajuda por PM! A tua dúvida vai ter menos atenção do que se for postada na secção correcta do fórum! Link to comment Share on other sites More sharing options...
Betovsky Posted November 20, 2007 at 09:23 PM Report Share #148999 Posted November 20, 2007 at 09:23 PM http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/81732 Presumo que é isto que queres, certo? "Give a man a fish and he will eat for a day; Teach a man to fish and he will eat for a lifetime. The moral? READ THE MANUAL !" Sign on a computer system consultant's desk Link to comment Share on other sites More sharing options...
djthyrax Posted November 20, 2007 at 09:26 PM Author Report Share #149000 Posted November 20, 2007 at 09:26 PM Parece-me que é, testo isso a seguir ao jantar. 🙂 Não peças ajuda por PM! A tua dúvida vai ter menos atenção do que se for postada na secção correcta do fórum! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now