(not really) randon ideas

O

oluoluolu

I have been programming in Python for many years, and I generally have
run into alot of the same problems repeatedly.

What is the consensus on these ideas please?

* enums
* constants
* an imagefile ala smalltalk
* symbols ala lisp/scheme

thx in advance
 
M

Marc 'BlackJack' Rintsch

oluoluolu said:
I have been programming in Python for many years, and I generally have
run into alot of the same problems repeatedly.

What is the consensus on these ideas please?

* enums

There's a cookbook recipe:

http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/413486

And a package in the Chesseshop:

http://cheeseshop.python.org/pypi/enum/0.4.1
* constants

People tend to write the names of constants all uppercase. Example::

ANSWER = 42

Ciao,
Marc 'BlackJack' Rintsch
 
O

oluoluolu

regarding the constants, this is more for the "vm" (and type safety).
actually enums, constants and symbols can prolly be implemented more or
less the same.
 
T

Tim Roberts

regarding the constants, this is more for the "vm" (and type safety).
actually enums, constants and symbols can prolly be implemented more or
less the same.

Ewww. For some reason, there's just something about the vulgar construct
"prolly" that really irks me, even more than "sth" for "something" or
"proggie" for "program".

You're only saving two keystrokes over the correct word, "probably", and
because it's split between the hands, "probably" is probably faster to
type.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top