• Home
  • Most Popular
  • Submit
  • About Us
  • Contact Us

Softpile

Free Downloads

Categories
  • Home
  • Most Popular
  • Communications
  • Desktop
  • Games & Entertainment
  • Graphic Apps
  • Network & Internet
  • Security & Privacy
  • System Utilities
Alternative to itextsharp 2022.11.10347
IronPDF offers an itextsharp alternative for HTML to PDF conversion with C# code examples, documentation, and ...
VShell Server for Linux and Mac 4.8
VShell is a versatile and secure file transfer server that supports multiple protocols and is compatible ...
PDF Studio PDF Editor for Linux 2022
PDF Studio is a cost-effective PDF editor that delivers full compatibility with the PDF Standard. It's ...
VQ Probe for Linux 1.5
VQ Probe is a comprehensive software tool that enables objective and subjective video quality analysis. The ...
Resilient Server 2.3
This Debian GNU/Linux (Buster) based software has a customized partitioning scheme that enhances robustness against filesystem ...
Valentina Studio for Linux 9.6
Valentina Studio is a cross-platform GUI manager for Mac, Windows, and Linux. It allows users to ...
VPN Lifeguard for Linux 1.0.58
The software monitors VPN connection and automatically terminates apps during connection loss, re-establishes the connection and ...
G_Viewer 0.84
G_Viewer is a Linux software that serves as both a file system and photo/image viewer. It ...
Checksome File Hash Tool for Linux 1.1
This software allows for the generation and verification of file hashes. It is a quick and ...
KeyWrangler Password Manager for Linux 1.2
A password management software that is secure, offline and extensible. It offers military-grade encryption to protect ...
Home Linux enum Download

enum

August 26, 2009
Python has strong support for enumerated types.
Version 0.4.4
License GPL
Platform Linux
Supported Languages English
Homepage savannah.nongnu.org
Developed by Ben Finney
I recently used the Python library, enum, and found it to be a great tool for creating robust enumerations in Python. With enum, creating an enumeration object is simple and can be done by providing a sequence of string arguments to the Enum() constructor.

For example, after importing Enum, I easily created an enumeration object for colours and weekdays:

>>> from enum import Enum
>>> Colours = Enum('red', 'blue', 'green')
>>> Weekdays = Enum('mon', 'tue', 'wed', 'thu', 'fri', 'sat', 'sun')

The return value is an immutable sequence object with a corresponding value for each of the string arguments supplied. Each value is also available as an attribute named from the corresponding string argument.

Furthermore, every value from an enumeration exports its sequence index as an integer and can be coerced to a simple string that matches the original arguments used to create the enumeration.

Using enum, I was able to easily compare the different values of the enumerations. The values are constants that can be compared only with values from the same enumeration. Any comparison with other values results in Python's fallback comparisons being invoked.

For example, I compared pizza night, which was a Thursday, with the fifth weekday, which is Friday:

>>> pizza_night = Weekdays[4]
>>> pizza_night == Weekdays.fri
True

I also found it easy to compare a shirt colour to other colours in the enumeration:

>>> shirt_colour = Colours.green
>>> shirt_colour > Colours.red
True
>>> shirt_colour == "green"
False

Overall, enum proved to be a valuable tool for working with enumerations in Python.
What's New

Version 0.4.4: N/A

Free Download 18K
343
  • Share on:

Most Popular

  1. Quicksilver Forums 1.4.2
    154
  2. Dvgrab 3.4
    102
  3. DynVPN 1.0
    89
  4. CherryTV 0.1
    81
  5. SlideMap 1.2.2
    80
  6. porm r2
    73
  7. Clewarecontrol 0.8
    72
  8. Java Games 1.0
    72
  9. Swiftfox 3.0b5pre-2
    71
  10. fuseftp 0.8
    71

Related Downloads

eximspamy
Eximspamy is a lightweight and low-maintenance spam filter software.
bwFXPbot
bwFXPbot is a file-sharing IRC bot that enables quick and easy distribution ...
WeirdX
WeirdX is a pure Java-based X Window System server that operates under ...
Pong2
Revamp the classic gameplay of Atari's first game with Pong2. Update the ...
JTVD
JTVD is a GUI interface for command line software like MEncoder, transcode, ...
Jagzilla alpha
Jagzilla is a set of Java-based components designed for Bugzilla.
Tk::ListboxDnD
This software comes with a Tk::Listbox widget that enables drag and drop ...
Celtix
Celtix provides a Java ESB runtime for enterprise services.
Colorifer
Colorifer colors output from other processes such as compilers or command line ...
X-develop
Omnicore's X-develop is a cross-platform IDE with support for multiple languages, making ...
Copyright © 1999-2025 Softpile Free Downloads
  • Most Popular
  • Submit
  • About Us
  • Contact Us
  • Privacy Policy
  • Disclaimer
  • Terms of Use

Can we use your data to tailor ads for you?

Our partners will collect data and use cookies for ad personalization and measurement.

By choosing "I agree", closing this pop-up or clicking on any element on the page, you agree to the use of cookies to help us provide you with a better user experience.

Learn how Softpile and our partners collect and use data.

You can change your choice at any time in our privacy center.

Cookie Settings

Our website stores four types of cookies. At any time you can choose which cookies you accept and which you refuse. You can read more about what cookies are and what types of cookies we store in our Cookie Policy.

are necessary for technical reasons. Without them, this website may not function properly.

are necessary for specific functionality on the website. Without them, some features may be disabled.

allow us to analyse website use and to improve the visitor's experience.

allow us to personalise your experience and to send you relevant content and offers, on this website and other websites.