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
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
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
In other words, when passing an unsupported type causes problems.
Rui Maciel
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
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
n a newbie?
Thanks in advance,
Rui Maciel
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
Mercurial supports only as a non-standard module: the
git stash feature.
Rui Maciel
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
tter how great the average HD
capacity is nowadays.
Rui Maciel
--
http://mail.python.org/mailman/listinfo/python-list
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
ant to use it have to install it.
The rest of us don't.
Rui Maciel
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
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
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
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;
>>
>>
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
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
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
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
#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
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
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
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
heck your post's user agent.
Rui Maciel
--
http://mail.python.org/mailman/listinfo/python-list
>
> 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
ties of any
spreadsheet application lets the
user define the field separator character.
Rui Maciel
--
http://mail.python.org/mailman/listinfo/python-list
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
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
ythonesque,
what are your thoughts on this?
Thanks for the help
Rui Maciel
--
http://mail.python.org/mailman/listinfo/python-list
51 matches
Mail list logo