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
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
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
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
= 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
passing an unsupported type causes problems.
Rui Maciel
--
http://mail.python.org/mailman/listinfo/python-list
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
?
Thanks in advance,
Rui Maciel
--
http://mail.python.org/mailman/listinfo/python-list
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
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
: the
git stash feature.
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
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
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
the same effect with Case B?
Thanks in advance,
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
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:
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
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
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
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
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
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
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
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
.
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 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
.
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
to install it.
The rest of us don't.
Rui Maciel
--
http://mail.python.org/mailman/listinfo/python-list
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
HD
capacity is nowadays.
Rui Maciel
--
http://mail.python.org/mailman/listinfo/python-list
independently and
at anyone's whims.
Hope this helps,
Rui Maciel
--
http://mail.python.org/mailman/listinfo/python-list
editor auto-wrap the lines? They can do that now.
Rui Maciel
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
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
, 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
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
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
representation and b) the precision errors
produced by arithmetic
operations.
Rui Maciel
--
http://mail.python.org/mailman/listinfo/python-list
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
.
Rui Maciel
--
http://mail.python.org/mailman/listinfo/python-list
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
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
are your thoughts on this?
Thanks for the help
Rui Maciel
--
http://mail.python.org/mailman/listinfo/python-list
51 matches
Mail list logo