Ticket #7637 (closed enhancement: fixed)
Default dictionary in MixedIntegerLinearProgram
| Reported by: | ncohen | Owned by: | jkantor |
|---|---|---|---|
| Priority: | major | Milestone: | sage-4.3 |
| Component: | numerical | Keywords: | |
| Cc: | malb | Work issues: | |
| Report Upstream: | N/A | Reviewers: | Martin Albrecht |
| Authors: | Nathann Cohen | Merged in: | sage-4.3.rc1 |
| Dependencies: | Stopgaps: |
Description
Martin Albrecht requested this functionality for his code, and it would also simplify mine. For short linear programs, of when some global variables do not require the creation of a new dictionary of variables ( from which only one field would be used ), this trick is good enough !
Nathann
Attachments
Change History
comment:1 Changed 3 years ago by malb
- try: foo except AttributeError: seems to be favoured in the Python community over hasattr. It is also faster if the attribute does in fact exist.
- Why do you call __getitem__() instead of using the normal syntax [x]?
Note: See
TracTickets for help on using
tickets.

