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 requires Python >= 3.5.

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.8

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

Release files for traits 6.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 6.0.0
File Size Uploaded
traits-6.0.0.tar.gz 441.6 kB Details

Release files / traits-6.0.0.tar.gz

Download URL traits-6.0.0.tar.gz
Size 441.6 kB
Tags Source
SHA-256 checksum
How to use checksums
dbcd70166feca434130a1193284d5819ca72ffbc8dbce8deeecc0cebb41a3bfb
BLAKE2b-256 checksum
How to use checksums
b9afc6dc88130106d69e4f9a192043c85ed4cb522f83b9041b8691f0b0678405
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/43.0.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.8.1

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

This release

6.0.0 This release

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

5.0.0

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