Skip to main content

http://docs.enthought.com/traits

Build status Coverage status

The Traits project is at the center of all Enthought Tool Suite development and has changed the mental model used at Enthought for programming in the already extremely efficient Python programming language. We encourage everyone to join us in enjoying the productivity gains from using such a powerful approach.

The Traits project allows Python programmers to use a special kind of type definition called a trait, which gives object attributes some additional characteristics:

  • Initialization: A trait has a default value, which is automatically set as the initial value of an attribute before its first use in a program.

  • Validation: The type of a trait attribute is explicitly declared. The type is evident in the code, and only values that meet a programmer-specified set of criteria (i.e., the trait definition) can be assigned to that attribute.

  • Delegation: The value of a trait attribute can be contained either in the defining object or in another object delegated to by the trait.

  • Notification: Setting the value of a trait attribute can notify other parts of the program that the value has changed.

  • Visualization: User interfaces that allow a user to interactively modify the value of a trait attribute can be automatically constructed using the trait’s definition. (This feature requires that a supported GUI toolkit be installed. If this feature is not used, the Traits project does not otherwise require GUI support.)

A class can freely mix trait-based attributes with normal Python attributes, or can opt to allow the use of only a fixed or open set of trait attributes within the class. Trait attributes defined by a class are automatically inherited by any subclass derived from the class.

Dependencies

Traits runs on both Python 2 and Python 3. It requires Python 2.7 or Python >= 3.4.

Traits has the following optional dependencies:

  • NumPy to support the trait types for arrays.

  • Traitsui to support Gui Views.

To build the full documentation one needs:

  • sphinx > 1.2.3

  • mock (optional if traitsui is not available)

  • enthought-sphinx-theme (a version of the documentation can be built without this, but some formatting may be incorrect)

Release files for traits 5.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for traits 5.0.0
File Size Uploaded
traits-5.0.0.tar.gz 437.0 kB Details

Release files / traits-5.0.0.tar.gz

Download URL traits-5.0.0.tar.gz
Size 437.0 kB
Tags Source
SHA-256 checksum
How to use checksums
8369117036fbbe00dbd40e1a01c8775b52bdbfa11db5788168e7c8c56663bac0
BLAKE2b-256 checksum
How to use checksums
b7209258e52af7e03265f838eb693386f0295b337e7d32974ffa150f5edc255b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.2 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.7.2

Release history Release notifications | RSS feed

7.2.0

49 release files

7.1.0

49 release files

7.0.2

49 release files

7.0.1

49 release files

7.0.0

13 release files

6.4.1

59 release files

6.4.0

34 release files

6.3.2

34 release files

6.3.1

34 release files

6.2.0

21 release files

6.1.1

1 release file

6.1.0

1 release file

6.0.0

1 release file

5.2.0

1 release file

5.1.2

1 release file

5.1.1

1 release file

5.1.0

1 release file

This release

5.0.0 This release

1 release file

4.6.0

3 release files

4.5.0

1 release file

4.4.0

1 release file

4.3.0

4.2.0

4.1.0

4.0.0

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page