Re: Newbie: use of built-in exceptions

2013-09-02 Thread Rui Maciel
Chris “Kwpolska” Warrick wrote: > There are no rules. You should use common sense instead: if the > exception fits your needs (eg. ValueError when incorrect output > occurs) then use it. Ok, thanks for the tip. Rui Maciel -- http://mail.python.org/mailman/listinfo/python-list

Newbie: use of built-in exceptions

2013-09-01 Thread Rui Maciel
Are there any guidelines on the use (and abuse) of Python's built-in exceptions, telling where it's ok to raise them and where it's preferable to define custom exceptions instead? Thanks in advance, Rui Maciel -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie: static typing?

2013-08-06 Thread Rui Maciel
Chris Angelico wrote: > On Tue, Aug 6, 2013 at 10:01 AM, Rui Maciel wrote: >> It would be nice if some functions threw an error if they were passed a >> type >> they don't support or weren't designed to handle. That would avoid >> having to deal with some bu

Re: Newbie: static typing?

2013-08-06 Thread Rui Maciel
In other words, when passing an unsupported type causes problems. Rui Maciel -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie: static typing?

2013-08-06 Thread Rui Maciel
r): def visit(self, element): element.label = "ConcreteVisitorB operated on this model" model = SomeModel() operatorA = ConcreteVisitorA() model.accept(operatorA) operatorB = ConcreteVisitorB() model.accept(operatorA) not_a_valid_type = "foo" m

Re: Newbie: static typing?

2013-08-06 Thread Rui Maciel
es, but that's no reason to hobble > Python with static typing.) What's the Python way of dealing with objects being passed to a function that aren't of a certain type, have specific attributes of a specific type, nor support a specific interface? Rui Maciel -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie: static typing?

2013-08-06 Thread Rui Maciel
Steven D'Aprano wrote: > On Mon, 05 Aug 2013 21:46:57 +0100, Rui Maciel wrote: > >> Is there any pythonic way to perform static typing? After searching the >> web I've stumbled on a significant number of comments that appear to >> cover static typing as a pro

Re: Newbie: static typing?

2013-08-06 Thread Rui Maciel
Ben Finney wrote: > Rui Maciel writes: > >> Is there any pythonic way to perform static typing? > > I think no; static typing is inherently un-Pythonic. > > Python provides strong, dynamic typing. Enjoy it! Bummer. >> Does anyone care to enlighten a newbi

Newbie: static typing?

2013-08-05 Thread Rui Maciel
n a newbie? Thanks in advance, Rui Maciel -- http://mail.python.org/mailman/listinfo/python-list

Newbie: Python 3 and web applications?

2013-07-26 Thread Rui Maciel
e, and they may not even be required to be accessible outside of a LAN. Does anyone have any tips on what's the best way to start off this adventure? Thanks in advance, Rui Maciel -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie: question regarding references and class relationships

2013-06-13 Thread Rui Maciel
lking about tkinter, which is his area of expertise), but frequently > he spouts rubbish. I had no idea. Thanks for the headsup. Rui Maciel -- http://mail.python.org/mailman/listinfo/python-list

Newbie: standard way to add version, author and license to a source file?

2013-06-13 Thread Rui Maciel
Is there any PEP that establishes a standard way to specify the version number of a source code file, as well as its authors and what license it's distributed under? Thanks in advance, Rui Maciel -- http://mail.python.org/mailman/listinfo/python-list

Re: Version Control Software

2013-06-13 Thread Rui Maciel
Mercurial supports only as a non-standard module: the git stash feature. Rui Maciel -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie: question regarding references and class relationships

2013-06-13 Thread Rui Maciel
Rick Johnson wrote: > On Monday, June 10, 2013 8:18:52 AM UTC-5, Rui Maciel wrote: >> [...] >> >> >> class Point: >> position = [] >> def __init__(self, x, y, z = 0): >> self.position = [x, y, z] > > Firstly. Wh

Re: Newbie: question regarding references and class relationships

2013-06-10 Thread Rui Maciel
static member variables and the latter being more like proper member variables. And there was light. Python.org's tutorial could cover this issue a bit better than it does. Thanks for the help, Rui Maciel -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie: question regarding references and class relationships

2013-06-10 Thread Rui Maciel
ood reasons for that, but it is always preferable to get the rationale behind a decision to be able to understand how things work and how to do things properly. Rui Maciel -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie: question regarding references and class relationships

2013-06-10 Thread Rui Maciel
Terry Jan Reedy wrote: > On 6/10/2013 9:18 AM, Rui Maciel wrote: > >> class Model: >> points = [] >> lines = [] > > Unless you actually need keep the points and lines ordered by entry > order, or expect to keep sorting them by whatever, sets ma

Re: Newbie: question regarding references and class relationships

2013-06-10 Thread Rui Maciel
exist. > Likewise if you can show a benefit of the > >>>position = [] > > line. I wrote the code that way to declare intent and help document the code. In this case that the class Point is expected to have an attribute named position which will point to a list. Rui Ma

Re: Newbie: question regarding references and class relationships

2013-06-10 Thread Rui Maciel
at's not a declaration, but a class attribute and in the long run it will cause nothing but trouble. We've established that you don't like attribute declarations, at least those you describe as not fulfill a technical purpose. What I don't understand is why you claim th

Re: Newbie: question regarding references and class relationships

2013-06-10 Thread Rui Maciel
Peter Otten wrote: > Rui Maciel wrote: > >> How do you guarantee that any object of a class has a specific set of >> attributes? > > You don't. What's your point regarding attribute assignments in class declarations, then? Rui Maciel -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie: question regarding references and class relationships

2013-06-10 Thread Rui Maciel
Peter Otten wrote: > Rui Maciel wrote: > >> Peter Otten wrote: >> >>> Don't add >>> >>>>position = [] >>> >>> to your code. That's not a declaration, but a class attribute and in the >>> long run it will

Re: Newbie: question regarding references and class relationships

2013-06-10 Thread Rui Maciel
Rui Maciel wrote: > # Case B: this doesn't work > test.model.points[0] = test.Point(5,4,7) Disregard the "test." bit. I was testing the code by importing the definitions as a module. Rui Maciel -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie: question regarding references and class relationships

2013-06-10 Thread Rui Maciel
Peter Otten wrote: > Don't add > >>position = [] > > to your code. That's not a declaration, but a class attribute and in the > long run it will cause nothing but trouble. Why's that? Rui Maciel -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie: question regarding references and class relationships

2013-06-10 Thread Rui Maciel
s there a Python way of getting the same effect with Case B? Thanks in advance, Rui Maciel -- http://mail.python.org/mailman/listinfo/python-list

Newbie: question regarding references and class relationships

2013-06-10 Thread Rui Maciel
h are associated with it could reflect those updates directly in Line.p_i and Line.p_f. What's the Python way of achieving the same effect? Thanks in advance, Rui Maciel -- http://mail.python.org/mailman/listinfo/python-list

Re: Ubuntu package "python3" does not include tkinter

2013-04-23 Thread Rui Maciel
components needed for it to run properly are already present in the system or can be installed automatically. http://en.wikipedia.org/wiki/Dependency_hell Rui Maciel -- http://mail.python.org/mailman/listinfo/python-list

Re: Ubuntu package "python3" does not include tkinter

2013-04-23 Thread Rui Maciel
the odd kilobyte of space. That must be reason why you are the only one complaining about that. Rui Maciel -- http://mail.python.org/mailman/listinfo/python-list

Re: Ubuntu package "python3" does not include tkinter

2013-04-22 Thread Rui Maciel
for it. Nothing stops you. If you don't then you aren't forced to install half the packages in the repository just to have a python interpreter in your system. Rui Maciel -- http://mail.python.org/mailman/listinfo/python-list

Re: Ubuntu package "python3" does not include tkinter

2013-04-22 Thread Rui Maciel
tter how great the average HD capacity is nowadays. Rui Maciel -- http://mail.python.org/mailman/listinfo/python-list

Re: Ubuntu package "python3" does not include tkinter

2013-04-22 Thread Rui Maciel
s doing is you. You want to distribute a software package? Package it. Learn the very basics and set python-tkinter as a dependency. http://wiki.debian.org/Packaging Rui Maciel -- http://mail.python.org/mailman/listinfo/python-list

Re: Ubuntu package "python3" does not include tkinter

2013-04-21 Thread Rui Maciel
ant to use it have to install it. The rest of us don't. Rui Maciel -- http://mail.python.org/mailman/listinfo/python-list

Re: Ubuntu package "python3" does not include tkinter

2013-04-21 Thread Rui Maciel
ming. Hurdles > like this don't help someone like him. If your friend believes that having to do an extra pair of clicks or typing sudo apt-get install python-tk is an unbeatable hurdle then your friend's computer skills are awfully lacking and he won't have much

Re: Functional vs. Object oriented API

2013-04-13 Thread Rui Maciel
ecoupled from the data type then it's possible to preserve the definition of that data type eternally, while the operators that are written to operate on it can be added, tweaked and removed independently and at anyone's whims. Hope this helps, Rui Maciel -- http://mail.python.org/mailman/listinfo/python-list

Re: In defence of 80-char lines

2013-04-04 Thread Rui Maciel
tions built into ancient terminals. Why not let the text editor auto-wrap the lines? They can do that now. Rui Maciel -- http://mail.python.org/mailman/listinfo/python-list

Re: Why is Ruby on Rails more popular than Django?

2013-03-07 Thread Rui Maciel
of competition, and therefore the absense of incentives to work on improvements. You know, progress. Choice is good. Don't pretend it isn't. It's one of the reasons we have stuff like Python or Ruby nowadays, for example. Rui Maciel -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Newbie

2013-02-23 Thread Rui Maciel
the existence of extensive libraries. Otherwise there would be no > good reason for Python to exist. Nevertheless, it does exist and I have to > learn it. As long as someone is paying for my time, that's OK with me. That's some military-grade trolling. Rui Maciel -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Newbie

2013-02-22 Thread Rui Maciel
Chris Angelico wrote: > On Fri, Feb 22, 2013 at 10:58 PM, Rui Maciel wrote: >> Mitya Sirenef wrote: >> >>> Looks very unclear and confusing to me. Whether it's C# or ruby or >>> anything else, most devs don't indent like that; >> >>

Re: Python Newbie

2013-02-22 Thread Rui Maciel
Mitya Sirenef wrote: > Looks very unclear and confusing to me. Whether it's C# or ruby or > anything else, most devs don't indent like that; The Go programming language makes that style mandatory. Rui Maciel -- http://mail.python.org/mailman/listinfo/python-list

Re: Is Python "venerable"?

2013-02-20 Thread Rui Maciel
1. of the first or highest quality, class, or rank: a classic piece of work. 2. serving as a standard, model, or guide: the classic method of teaching arithmetic. http://dictionary.reference.com/browse/classic Rui Maciel -- http://mail.python.org/mailman/listinfo/python-list

Re: Guy Steele on Parallel Programing

2011-02-05 Thread Rui Maciel
Xah Lee wrote: > might be interesting. > > 〈Guy Steele on Parallel Programing〉 > http://xahlee.org/comp/Guy_Steele_parallel_computing.html Very interesting. Thanks for the link. Rui Maciel -- http://mail.python.org/mailman/listinfo/python-list

Re: Use the Source Luke

2011-01-28 Thread Rui Maciel
Raymond Hettinger wrote: > Have any of you all seen other examples besides > the Go language docs and the Python docs? Wasn't doxygen developed with that in mind? Rui Maciel -- http://mail.python.org/mailman/listinfo/python-list

Re: [OT] Python like lanugages [was Re: After C++, what with Python?]

2011-01-18 Thread Rui Maciel
#x27;t touch it then distributing the source code is essentially meaningless. There is a good reason why "open source software" is not the same thing as "free software". Rui Maciel -- http://mail.python.org/mailman/listinfo/python-list

Re: "Strong typing vs. strong testing"

2010-10-01 Thread Rui Maciel
itful. If an undergraduate student happens to write a C compiler for a compiler class which employs no optimization whatsoevere then that will not mean that every single C compiler is incapable of generating efficient code. Rui Maciel [1] http://coyotegulch.com/reviews/gcc4/index.html -- http://mail.python.org/mailman/listinfo/python-list

Re: "Strong typing vs. strong testing"

2010-10-01 Thread Rui Maciel
resent a certain number in a specific representation and b) the precision errors produced by arithmetic operations. Rui Maciel -- http://mail.python.org/mailman/listinfo/python-list

Re: "Strong typing vs. strong testing"

2010-10-01 Thread Rui Maciel
e X or Y does nothing to tackle the issues related to passing a variable/object of the "wrong" type as a parameter to some function. Rui Maciel -- http://mail.python.org/mailman/listinfo/python-list

Re: Fascinating interview by Richard Stallman at KTH on emacs history and internals

2010-07-19 Thread Rui Maciel
heck your post's user agent. Rui Maciel -- http://mail.python.org/mailman/listinfo/python-list

Re: Fascinating interview by Richard Stallman on Russia TV

2010-07-17 Thread Rui Maciel
> > I am sick of such jews/zionists like RMS, Roman Polansky, Bernard > Madoff, Larry Ellison (he had to pay 100K in court to a chinese girl > he screwed), Stephen Wolfram, Albert Einstein spreading anti-semitism > by their flagrant unethical behaviour. You are a lousy troll. Rui

Re: A Exhibition Of Tech Geekers Incompetence: Emacs whitespace-mode

2009-08-18 Thread Rui Maciel
ties of any spreadsheet application lets the user define the field separator character. Rui Maciel -- http://mail.python.org/mailman/listinfo/python-list

Re: If Scheme is so good why MIT drops it?

2009-07-23 Thread Rui Maciel
fft1976 wrote: > How do you explain that something as inferior as Python beat Lisp in > the market place despite starting 40 years later. Probably due to similar reasons that lead php to become remotely relevant. Rui Maciel -- http://mail.python.org/mailman/listinfo/python-list

Re: Is this a good time to start learning python?

2008-04-01 Thread Rui Maciel
After reading all replies I've decided to keep the subscription to this group, crank up the tutorials and start getting my head around Python. Thanks for all the helpful replies. Kudos, everyone! Rui Maciel -- http://mail.python.org/mailman/listinfo/python-list

Is this a good time to start learning python?

2008-03-31 Thread Rui Maciel
ythonesque, what are your thoughts on this? Thanks for the help Rui Maciel -- http://mail.python.org/mailman/listinfo/python-list