Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Bernardo Sulzbach Newsgroups: comp.lang.python Subject: Re: When I need classes? Date: Sun, 10 Jan 2016 15:48:53 -0200 Lines: 10 Message-ID: References: <56927b37$0$1586$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de g0i9bXZapzUu9bdQ0BjmKwdp+bfrRI2pVaJBUXiPThgg== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.029 X-Spam-Evidence: '*H*': 0.94; '*S*': 0.00; 'classes,': 0.05; 'classes.': 0.07; 'tool,': 0.07; 'scripting': 0.09; 'python': 0.10; 'feasible': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'subject:need': 0.18; 'tuples': 0.22; 'passing': 0.23; 'header:In-Reply-To:1': 0.24; 'message-id:@mail.gmail.com': 0.27; 'purposes.': 0.29; 'classes': 0.30; 'problem': 0.33; 'usually': 0.33; 'add': 0.34; 'received:google.com': 0.35; 'done': 0.35; 'received:209.85': 0.36; 'to:addr:python-list': 0.36; 'subject:?': 0.36; 'subject:: ': 0.37; 'received:209': 0.38; 'data': 0.39; 'to:addr:python.org': 0.40; 'some': 0.40; 'your': 0.60; 'more': 0.63; 'between': 0.65; 'complexity': 0.84; 'received:209.85.215.42': 0.84; 'subject:When': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=vdLysmrUtWGEmoE3gp2N+AXbjog/gK4UddeKpMuh63k=; b=un8y+p0azHfbfv+yzuSO9BWCtBVoyj+nrDQM30CVvSQ08K08p+NCY+DxYoLJJFlQys YkyQvyVv4iVXXnSLJ5zM75jBNy2aNj5v7Ppi+ZFWIgEI/SU/X2W6jSKDpTk9Nzf5znu+ ob5qqAM8aYB/3hlovUDQnxFhFzLkItT+jDlzzcIOvJifOJ1icty0/gV+uaTBgFvRGPyz A9hVEt0ZdyPKN9ecu0qes++CHwGeaSYnpnJJuydfKhpgLRfpYTOeRTpfICB50oIQWqcg SxaGSMxlS1x6U9MwXnNIgRwtGQ+rKauEYHbHfEDPAsC8unOc+nSOdq58aZRtKhfVjB6+ ZqLQ== X-Received: by 10.25.153.79 with SMTP id b76mr37564692lfe.102.1452448173147; Sun, 10 Jan 2016 09:49:33 -0800 (PST) In-Reply-To: <56927b37$0$1586$c3e8da3$5496439d@news.astraweb.com> X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:101440 Essentially, classes (as modules) are used mainly for organizational purposes. Although you can solve any problem you would solve using classes without classes, solutions to some big problems may be cheaper and more feasible using classes. If Python is your everyday scripting tool, you will usually not need classes, they will add more complexity than you need and passing data between functions may be done with well-documented tuples and dictionaries.