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
Ben Finney wrote: Rui Maciel rui.mac...@gmail.com 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 newbie? Is there some

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 proof of concept , but in the process I've

Re: Newbie: static typing?

2013-08-06 Thread Rui Maciel
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
= ConcreteVisitorB operated on this model model = SomeModel() operatorA = ConcreteVisitorA() model.accept(operatorA) operatorB = ConcreteVisitorB() model.accept(operatorA) not_a_valid_type = foo model.accept(not_a_valid_type) /python Rui Maciel -- http://mail.python.org/mailman/listinfo/python

Re: Newbie: static typing?

2013-08-06 Thread Rui Maciel
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
Chris Angelico wrote: On Tue, Aug 6, 2013 at 10:01 AM, Rui Maciel rui.mac...@gmail.com 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 bugs which otherwise would

Newbie: static typing?

2013-08-05 Thread Rui Maciel
? 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
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
Rick Johnson wrote: On Monday, June 10, 2013 8:18:52 AM UTC-5, Rui Maciel wrote: [...] code class Point: position = [] def __init__(self, x, y, z = 0): self.position = [x, y, z] Firstly. Why would you define a Point object that holds it's x,y,z values

Re: Version Control Software

2013-06-13 Thread Rui Maciel
: the git stash feature. 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: Newbie: question regarding references and class relationships

2013-06-13 Thread Rui Maciel
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: question regarding references and class relationships

2013-06-10 Thread Rui Maciel
which 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: Newbie: question regarding references and class relationships

2013-06-10 Thread Rui Maciel
the same effect with Case B? Thanks in advance, 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
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: 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 cause nothing but trouble. Why's that? Especially with mutable attributes it's hard to keep track whether

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
attribute and in the long run it will cause nothing but trouble. /quote 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 that that would cause nothing but trouble. Rui Maciel

Re: Newbie: question regarding references and class relationships

2013-06-10 Thread Rui Maciel
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 Maciel -- http://mail.python.org/mailman/listinfo/python

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 may be better than lists. Testing

Re: Newbie: question regarding references and class relationships

2013-06-10 Thread Rui Maciel
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
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: Ubuntu package python3 does not include tkinter

2013-04-23 Thread Rui Maciel
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-23 Thread Rui Maciel
. 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-23 Thread Rui Maciel
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-22 Thread Rui Maciel
. 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 success learning how to write programs. Rui Maciel -- http://mail.python.org

Re: Ubuntu package python3 does not include tkinter

2013-04-22 Thread Rui Maciel
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-22 Thread Rui Maciel
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-22 Thread Rui Maciel
HD capacity is nowadays. Rui Maciel -- http://mail.python.org/mailman/listinfo/python-list

Re: Functional vs. Object oriented API

2013-04-13 Thread Rui Maciel
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
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 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
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
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: Python Newbie

2013-02-22 Thread Rui Maciel
Chris Angelico wrote: On Fri, Feb 22, 2013 at 10:58 PM, Rui Maciel rui.mac...@gmail.com 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; The Go programming language makes that style mandatory

Re: Is Python venerable?

2013-02-20 Thread Rui Maciel
, 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
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
independent of a language's typing system. Therefore, arguing about the need to perform sanity checks on programs written on language 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

Re: Strong typing vs. strong testing

2010-10-01 Thread Rui Maciel
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
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: Fascinating interview by Richard Stallman at KTH on emacs history and internals

2010-07-19 Thread Rui Maciel
. 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
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. snip more nonsense/ You are a lousy troll. Rui Maciel

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

2009-08-18 Thread Rui Maciel
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
are your thoughts on this? Thanks for the help Rui Maciel -- http://mail.python.org/mailman/listinfo/python-list